From 084978f3d0306b7800c3ce64bf99ba30e6ac2fb1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 3 Sep 2012 12:57:18 +0200 Subject: s3: Slightly simplify fd_open_atomic Replace an if-statement by a direct assignment Signed-off-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Sep 5 01:56:46 CEST 2012 on sn-devel-104 --- source3/smbd/open.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a4d4a3de31..6378521d76 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -563,14 +563,13 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, * Fail if already exists, just pass through. */ status = fd_open(conn, fsp, flags, mode); - if (NT_STATUS_IS_OK(status)) { - /* - * Here we've opened with O_CREAT|O_EXCL - * and got success. We *know* we created - * this file. - */ - *file_created = true; - } + + /* + * Here we've opened with O_CREAT|O_EXCL. If that went + * NT_STATUS_OK, we *know* we created this file. + */ + *file_created = NT_STATUS_IS_OK(status); + return status; } -- cgit