1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2023-09-05 14:50:05 +02:00 committed by Ralph Boehme
parent 45005d4b71
commit df78af9893

View File

@ -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;