diff options
author | Volker Lendecke <vl@samba.org> | 2012-09-03 12:57:18 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-09-05 01:56:46 +0200 |
commit | 084978f3d0306b7800c3ce64bf99ba30e6ac2fb1 (patch) | |
tree | 9905d1531788aa0c60a38f44e0082b31294203e5 | |
parent | d95d32606b5f90e865c3c8eef95f14be938b3bbe (diff) | |
download | samba-084978f3d0306b7800c3ce64bf99ba30e6ac2fb1.tar.gz samba-084978f3d0306b7800c3ce64bf99ba30e6ac2fb1.tar.bz2 samba-084978f3d0306b7800c3ce64bf99ba30e6ac2fb1.zip |
s3: Slightly simplify fd_open_atomic
Replace an if-statement by a direct assignment
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 5 01:56:46 CEST 2012 on sn-devel-104
-rw-r--r-- | source3/smbd/open.c | 15 |
1 files 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; } |