1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-26 13:44:19 +03:00

libsmb: Avoid two calls to SMBC_errno()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke
2022-01-21 20:38:04 +01:00
committed by Jeremy Allison
parent 098fc00f9f
commit c78f0a96a3

View File

@@ -1734,9 +1734,11 @@ SMBC_rmdir_ctx(SMBCCTX *context,
}
/*d_printf(">>>rmdir: resolved path as %s\n", targetpath);*/
if (!NT_STATUS_IS_OK(cli_rmdir(targetcli, targetpath))) {
status = cli_rmdir(targetcli, targetpath);
errno = SMBC_errno(context, targetcli);
if (!NT_STATUS_IS_OK(status)) {
errno = cli_status_to_errno(status);
if (errno == EACCES) { /* Check if the dir empty or not */
@@ -1759,9 +1761,8 @@ SMBC_rmdir_ctx(SMBCCTX *context,
if (!NT_STATUS_IS_OK(status)) {
/* Fix errno to ignore latest error ... */
DEBUG(5, ("smbc_rmdir: "
"cli_list returned an error: %d\n",
SMBC_errno(context, targetcli)));
DBG_INFO("cli_list returned an error: %s\n",
nt_errstr(status));
errno = EACCES;
}