smbd: Simplify fd_open_atomic()
authorVolker Lendecke <vl@samba.org>
Wed, 24 Jul 2019 15:39:59 +0000 (17:39 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 10 Aug 2019 00:07:28 +0000 (00:07 +0000)
commitfe26ff6e911f835808ac3f465822f86260407020
treebfaa12e585b948d4adeb7588dafddeb24eeb5412
parent16b56549d2ca6aad68467116ca08829c1144a41b
smbd: Simplify fd_open_atomic()

* Assign *file_created on every exit.

* Directly assign curr_flags without &= / |=

Both of these changes make the routine easier to understand for me,
less jumping around in the code to see where the values came from.

* Do the retry in a "positive" if-clause

Normally I'm a big fan of early returns, but this single retry is so
simple that to me it's easier to understand this way.

Overall, 13 lines less code. YMMV :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 10 00:07:28 UTC 2019 on sn-devel-184
source3/smbd/open.c