From: Volker Lendecke Date: Tue, 5 Sep 2023 12:50:05 +0000 (+0200) Subject: smbd: Simplify an if-condition in open_file() X-Git-Tag: tevent-0.16.0~228 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df78af98936774cc1c01729eb4280877cbc05ff6;p=thirdparty%2Fsamba.git smbd: Simplify an if-condition in open_file() We use the plain (flags&O_TRUNC) a few lines above, make the if-condition a bit more readable. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 3b7236b8895..ba1341de0d7 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1375,8 +1375,7 @@ static NTSTATUS open_file(struct smb_request *req, * as we always opened files read-write in that release. JRA. */ - if (((flags & O_ACCMODE) == O_RDONLY) && - ((flags & O_TRUNC) == O_TRUNC)) { + if (((flags & O_ACCMODE) == O_RDONLY) && (flags & O_TRUNC)) { DEBUG(10,("open_file: truncate requested on read-only open " "for file %s\n", smb_fname_str_dbg(smb_fname))); local_flags = (flags & ~O_ACCMODE)|O_RDWR;