]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Avoid a call to SMBC_errno()
authorVolker Lendecke <vl@samba.org>
Sun, 13 Feb 2022 08:25:54 +0000 (09:25 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Feb 2022 17:13:34 +0000 (17:13 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/libsmb_file.c

index 499be92cb4a95f2358ccbfa503e4cd76094fcda2..fa301b9fa1872eb948f54e31d957331344db3a7d 100644 (file)
@@ -197,12 +197,11 @@ SMBC_open_ctx(SMBCCTX *context,
        /* Check if opendir needed ... */
 
        if (!NT_STATUS_IS_OK(status)) {
-               int eno = 0;
-
-               eno = SMBC_errno(context, srv->cli);
                file = smbc_getFunctionOpendir(context)(context, fname);
-               if (!file) errno = eno;
                TALLOC_FREE(frame);
+               if (file == NULL) {
+                       errno = cli_status_to_errno(status);
+               }
                return file;
        }