From df78af98936774cc1c01729eb4280877cbc05ff6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 5 Sep 2023 14:50:05 +0200 Subject: [PATCH] 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 --- source3/smbd/open.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.47.3