From a51278067b47a7c2afe9ca0f32bc8fd340ce6a57 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 8 Jun 2012 14:26:52 +0200 Subject: s3: Replace an if with a boolean short circuit Signed-off-by: Michael Adam --- source3/smbd/files.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3/smbd') 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; -- cgit