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 <kai@samba.org>
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104
*********************************************************************/
NTSTATUS map_nt_error_from_unix(int unix_error);
+/*********************************************************************
+convert a Unix error code to a WERROR
+*********************************************************************/
+WERROR unix_to_werror(int unix_error);
+
#endif /* _SAMBA_ERROR_H */
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;
return NT_STATUS_UNSUCCESSFUL;
}
+/* Convert a Unix error code to WERROR */
+WERROR unix_to_werror(int unix_error)
+{
+ return ntstatus_to_werror(map_nt_error_from_unix(unix_error));
+}
+
NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err)
{
switch (ndr_err) {