X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-cloexec.c;h=374de3038672af3ca72599558dff97bc4f41cabf;hb=ca2c85799ac5e86ba2d93a6b0628648177984e21;hp=a29d1be739fed35d2789e94c8808cec0fd605c23;hpb=73da5fb7e129f1fa540e040582cda710b8c2cce4;p=gnulib.git diff --git a/tests/test-cloexec.c b/tests/test-cloexec.c index a29d1be73..374de3038 100644 --- a/tests/test-cloexec.c +++ b/tests/test-cloexec.c @@ -1,5 +1,5 @@ /* Test duplicating non-inheritable file descriptors. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,8 +22,6 @@ #include #include -#include -#include #include #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ @@ -33,18 +31,7 @@ #endif #include "binary-io.h" - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" /* Return non-zero if FD is open and inheritable across exec/spawn. */ static int @@ -69,7 +56,8 @@ is_inheritable (int fd) } #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