errormap: Add unix_to_werror() function
[ira/wip.git] / libcli / util / errormap.c
index f96d83fa62a95fdfed162902b13da22b3f77d74e..714e62c0d79ce2260c848811411620fde5cc8d23 100644 (file)
@@ -1238,3 +1238,8 @@ WERROR ntstatus_to_werror(NTSTATUS error)
        return W_ERROR(NT_STATUS_V(error) & 0xffff);
 }
 
+/* Convert a Unix error code to a WERROR. */
+WERROR unix_to_werror(int unix_error)
+{
+       return ntstatus_to_werror(map_nt_error_from_unix_common(unix_error));
+}