From 278c6f8fc538ad8ee069f0682229fad34abb3513 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Wed, 26 Jan 2011 22:17:43 +0100 Subject: errormap: Add unix_to_werror() function While this function technically is closest to the map_nt_status_from_unix() function, I think it is better to keep the new function in line with our usual fooerror_to_barerror() naming scheme. Signed-off-by: Kai Blin Autobuild-User: Kai Blin Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104 --- source3/lib/errmap_unix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c index 91a620ecce..b4a98f9634 100644 --- a/source3/lib/errmap_unix.c +++ b/source3/lib/errmap_unix.c @@ -141,6 +141,12 @@ NTSTATUS map_nt_error_from_unix(int unix_error) return NT_STATUS_ACCESS_DENIED; } +/* Convert a Unix error code to a WERROR. */ +WERROR unix_to_werror(int unix_error) +{ + return ntstatus_to_werror(map_nt_error_from_unix(unix_error)); +} + /* Return a UNIX errno from a NT status code */ static const struct { NTSTATUS status; -- cgit