1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: Simplify logic in smb2_lease_break_send

If/else if chains are hard to follow to me. Simplify the code by using
early returns.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2018-07-26 14:52:55 +02:00 committed by Andreas Schneider
parent c2281341cb
commit 6a78201419

View File

@ -386,14 +386,16 @@ static struct tevent_req *smbd_smb2_lease_break_send(
status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
DEBUG(10, ("No record for lease key found\n"));
}
} else if (!NT_STATUS_IS_OK(lls.status)) {
status = lls.status;
} else if (lls.num_file_ids == 0) {
status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
if (tevent_req_nterror(req, lls.status)) {
return tevent_req_post(req, ev);
}
if (lls.num_file_ids == 0) {
tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND);
return tevent_req_post(req, ev);
}