Fix the overwriting of errno before use in a DEBUG statement and use the return value...
[ddiss/samba.git] / source3 / modules / vfs_acl_xattr.c
index ca23fad179160978acb7bfb65d52cfc2d7d2ab95..12ed82939a3959248b02b3f2a1a0ed7bc5bd8e9f 100644 (file)
@@ -119,12 +119,12 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
        }
        unbecome_root();
        if (ret) {
-               errno = saved_errno;
                DEBUG(5, ("store_acl_blob_fsp: setting attr failed for file %s"
                        "with error %s\n",
                        fsp_str_dbg(fsp),
-                       strerror(errno) ));
-               return map_nt_error_from_unix(errno);
+                       strerror(saved_errno) ));
+               errno = saved_errno;
+               return map_nt_error_from_unix(saved_errno);
        }
        return NT_STATUS_OK;
 }