Fix the overwriting of errno before use in a DEBUG statement and use the return value...
[samba.git] / source3 / modules / vfs_acl_xattr.c
index 5653657066d4ac8957143e0729e5d72460046b14..c1b0a60e16a7c5457b7e6e731a1a2bfffb30bd5a 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;
 }