Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/gen wrap the macro in do/while.



details:   https://anonhg.NetBSD.org/src/rev/f4e61b4a5e36
branches:  trunk
changeset: 820547:f4e61b4a5e36
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 11 07:26:17 2017 +0000

description:
wrap the macro in do/while.

diffstat:

 tests/lib/libc/gen/t_dir.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (28 lines):

diff -r 3975caaf7bf1 -r f4e61b4a5e36 tests/lib/libc/gen/t_dir.c
--- a/tests/lib/libc/gen/t_dir.c        Wed Jan 11 07:22:43 2017 +0000
+++ b/tests/lib/libc/gen/t_dir.c        Wed Jan 11 07:26:17 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dir.c,v 1.7 2017/01/10 15:19:00 christos Exp $ */
+/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -55,12 +55,12 @@
        struct dirent *entry;
        long here;
 
-#define        CREAT(x, m)     do {                                    \
-               int _creat_fd;                                  \
-               ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))),  \
-                   "creat(%s, %x) failed: %s", (x), (m),       \
-                   strerror(errno));                           \
-               (void)close(_creat_fd);                 \
+#define        CREAT(x, m)     do {                                            \
+               int _creat_fd;                                          \
+               ATF_REQUIRE_MSG((_creat_fd = creat((x), (m)) != -1),    \
+                   "creat(%s, %x) failed: %s", (x), (m),               \
+                   strerror(errno));                                   \
+               (void)close(_creat_fd);                                 \
        } while(0);
 
        ATF_REQUIRE_MSG(mkdir("t", 0755) == 0,



Home | Main Index | Thread Index | Old Index