projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint.mk: include 4 more function names in alloca.h-checking regexp
[gnulib.git]
/
tests
/
test-dup3.c
diff --git
a/tests/test-dup3.c
b/tests/test-dup3.c
index
9c88e75
..
a719234
100644
(file)
--- a/
tests/test-dup3.c
+++ b/
tests/test-dup3.c
@@
-1,5
+1,5
@@
/* Test duplicating file descriptors.
/* Test duplicating file descriptors.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009
, 2010
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
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
@@
-21,11
+21,12
@@
#include <unistd.h>
#include <unistd.h>
+#include "signature.h"
+SIGNATURE_CHECK (dup3, int, (int, int, int));
+
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the Win32 API functions. */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the Win32 API functions. */
@@
-34,18
+35,7
@@
#endif
#include "binary-io.h"
#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 true if FD is open. */
static bool
/* Return true if FD is open. */
static bool
@@
-99,7
+89,7
@@
main ()
o_flags = 0;
#if defined O_CLOEXEC
if (use_cloexec)
o_flags = 0;
#if defined O_CLOEXEC
if (use_cloexec)
- o_flags |= O_CLOEXEC;
+
o_flags |= O_CLOEXEC;
#endif
/* Assume std descriptors were provided by invoker. */
#endif
/* Assume std descriptors were provided by invoker. */
@@
-141,9
+131,9
@@
main ()
ASSERT (!is_open (fd + 1));
ASSERT (is_open (fd + 2));
if (use_cloexec)
ASSERT (!is_open (fd + 1));
ASSERT (is_open (fd + 2));
if (use_cloexec)
- ASSERT (is_cloexec (fd + 2));
+
ASSERT (is_cloexec (fd + 2));
else
else
- ASSERT (!is_cloexec (fd + 2));
+
ASSERT (!is_cloexec (fd + 2));
/* Verify that dup3 closes the previous occupant of a fd. */
ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1);
/* Verify that dup3 closes the previous occupant of a fd. */
ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1);