r23771: Merge useful W_ERROR_NOT_OK_RETURN macro from samba4.
authorGünther Deschner <gd@samba.org>
Mon, 9 Jul 2007 15:53:08 +0000 (15:53 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:55 +0000 (12:23 -0500)
Guenther
(This used to be commit 31d689b2486b23d73618f36febde3e17cba5ca59)

source3/include/nt_status.h

index 471ac47927a7d8f1ed9415763a252ceca35a560e..4d083106d3ece7e357967829e51c08c3fdfdde60 100644 (file)
@@ -72,6 +72,12 @@ typedef uint32 WERROR;
        }\
 } while (0)
 
+#define W_ERROR_NOT_OK_RETURN(x) do { \
+       if (!W_ERROR_IS_OK(x)) {\
+               return x;\
+       }\
+} while (0)
+
 /* The top byte in an NTSTATUS code is used as a type field.
  * Windows only uses value 0xC0 as an indicator for an NT error
  * and 0x00 for success.