bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix error handling macro E


From: Justus Winter
Subject: [PATCH] Fix error handling macro E
Date: Fri, 19 Jul 2013 08:53:53 +0200

Previously the macro argument err was expanded and thus potentially
evaluated multiple times. This is fine for simple values or pure
functions, but not for say iohelp_create_iouser. Fix this by
evaluating the macro argument only once.
---
 libiohelp/iouser-create.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libiohelp/iouser-create.c b/libiohelp/iouser-create.c
index f1dd2f0..980c8a1 100644
--- a/libiohelp/iouser-create.c
+++ b/libiohelp/iouser-create.c
@@ -33,8 +33,9 @@ iohelp_create_iouser (struct iouser **user, struct idvec 
*uids,
   return 0;
 }
 
-#define E(err)                         \
+#define E(err_)                                \
        do {                            \
+         error_t err = err_;           \
          if (err)                      \
            {                           \
              *user = 0;                \
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]