diff options
author | Volker Lendecke <vl@samba.org> | 2012-06-08 14:26:52 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-06-08 21:29:20 +0200 |
commit | 088ca00b926894575e75a03756642b9726f421d7 (patch) | |
tree | 85aee0768ecd3ebf576ed8f874f0775b0ae4c474 | |
parent | a3b4a5d7793b208436e541f2382c96c35fa31089 (diff) | |
download | samba-088ca00b926894575e75a03756642b9726f421d7.tar.gz samba-088ca00b926894575e75a03756642b9726f421d7.tar.bz2 samba-088ca00b926894575e75a03756642b9726f421d7.zip |
s3: Replace an if with a boolean short circuit
Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | source3/smbd/open.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d5fba4db19..7708833f97 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -777,11 +777,9 @@ static NTSTATUS open_file(files_struct *fsp, fsp->file_pid = req ? req->smbpid : 0; fsp->can_lock = True; fsp->can_read = ((access_mask & FILE_READ_DATA) != 0); - if (!CAN_WRITE(conn)) { - fsp->can_write = False; - } else { - fsp->can_write = ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0); - } + fsp->can_write = + CAN_WRITE(conn) && + ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0); fsp->print_file = NULL; fsp->modified = False; fsp->sent_oplock_break = NO_BREAK_SENT; |