diff tests/test-dup2.c @ 12399:7b2940180b02

unistd-safer: add unit test Add more unit tests. Meanwhile, fix compilation error on mingw when testing unistd-safer and fchdir together; and avoid gcc warning on platforms without setmode. * modules/unistd-safer-tests: New file. * tests/test-dup-safer.c: Likewise. * tests/test-cloexec.c (setmode): Avoid compiler warning. * tests/test-dup2.c (setmode): Likewise. * lib/cloexec.c (dup_cloexec): Fix mingw compile error. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Mon, 07 Dec 2009 10:17:07 -0700
parents 8700bea78e67
children 33ab12a7cea2
line wrap: on
line diff
--- a/tests/test-dup2.c
+++ b/tests/test-dup2.c
@@ -86,7 +86,8 @@
 }
 
 #if !O_BINARY
-# define setmode(f,m) 0
+# define setmode(f,m) zero ()
+static int zero (void) { return 0; }
 #endif
 
 /* Return non-zero if FD is open in the given MODE, which is either