mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
smbd: Simplify reopen_from_fsp() with an early return
Review with git show -b Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
1d6762d86b
commit
e93f46357f
@ -1227,25 +1227,25 @@ static NTSTATUS reopen_from_fsp(struct files_struct *fsp,
|
||||
status = reopen_from_procfd(fsp,
|
||||
flags,
|
||||
mode);
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
|
||||
/*
|
||||
* Close the existing pathref fd and set the fsp flag
|
||||
* is_pathref to false so we get a "normal" fd this
|
||||
* time.
|
||||
*/
|
||||
status = fd_close(fsp);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
fsp->fsp_flags.is_pathref = false;
|
||||
|
||||
status = fd_open_atomic(fsp,
|
||||
flags,
|
||||
mode,
|
||||
p_file_created);
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the existing pathref fd and set the fsp flag
|
||||
* is_pathref to false so we get a "normal" fd this time.
|
||||
*/
|
||||
status = fd_close(fsp);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
fsp->fsp_flags.is_pathref = false;
|
||||
|
||||
status = fd_open_atomic(fsp,
|
||||
flags,
|
||||
mode,
|
||||
p_file_created);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user