summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-09-23 10:10:51 +0100
committerPádraig Brady <P@draigBrady.com>2009-09-23 14:33:40 +0100
commita037e838e15c9a698f1634398e0fe2726398d575 (patch)
tree7361ac5f2c3dbd8fc4763e6fa960e6646670dc79 /src/copy.c
parentade8dd2096e1898edefadf2314d4e1ec654adda5 (diff)
downloadcoreutils-a037e838e15c9a698f1634398e0fe2726398d575.tar.xz
maint: Use logical rather than bitwise operators on bools
This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1)
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index 067b1e722..e3c5c523a 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -363,11 +363,11 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
group. Avoid the window by first changing to a restrictive
temporary mode if necessary. */
- if (!new_dst && (x->preserve_mode | x->move_mode | x->set_mode))
+ if (!new_dst && (x->preserve_mode || x->move_mode || x->set_mode))
{
mode_t old_mode = dst_sb->st_mode;
mode_t new_mode =
- (x->preserve_mode | x->move_mode ? src_sb->st_mode : x->mode);
+ (x->preserve_mode || x->move_mode ? src_sb->st_mode : x->mode);
mode_t restrictive_temp_mode = old_mode & new_mode & S_IRWXU;
if ((USE_ACL