summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-08 14:26:52 +0200
committerMichael Adam <obnox@samba.org>2012-06-08 21:29:19 +0200
commita51278067b47a7c2afe9ca0f32bc8fd340ce6a57 (patch)
tree351f73712ad7f3e3929c5c0814687fb61210e988 /source3
parent91be6b42f1a23d716d5f1116ebbb0ad71619ed1a (diff)
downloadsamba-a51278067b47a7c2afe9ca0f32bc8fd340ce6a57.tar.gz
samba-a51278067b47a7c2afe9ca0f32bc8fd340ce6a57.tar.bz2
samba-a51278067b47a7c2afe9ca0f32bc8fd340ce6a57.zip
s3: Replace an if with a boolean short circuit
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/files.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index b8142b0290..c0ebb9893a 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -604,11 +604,9 @@ NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
to->oplock_type = from->oplock_type;
to->can_lock = from->can_lock;
to->can_read = ((access_mask & FILE_READ_DATA) != 0);
- if (!CAN_WRITE(from->conn)) {
- to->can_write = False;
- } else {
- to->can_write = ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0);
- }
+ to->can_write =
+ CAN_WRITE(from->conn) &&
+ ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0);
to->modified = from->modified;
to->is_directory = from->is_directory;
to->aio_write_behind = from->aio_write_behind;