Mercurial > hg > octave-lojdl > gnulib-hg
changeset 14425:94b18c3c925d
passfd test: Fix warnings.
* tests/test-passfd.c: Include <sys/wait.h>.
(main): Fix typo.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 13 Mar 2011 23:40:23 +0100 |
parents | 7be307034349 |
children | cd6fec31364f |
files | tests/test-passfd.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-passfd.c +++ b/tests/test-passfd.c @@ -25,6 +25,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> +#include <sys/wait.h> #include "macros.h" @@ -86,8 +87,7 @@ } ASSERT (ret == pid); - ret = WIFEXITED (status); - if (ret == 0) + if (!WIFEXITED (status)) { fprintf (stderr, "Child does not normally exit\n"); return 65; @@ -100,8 +100,8 @@ } /* try to stat new fd */ - ret == fstat (fd, &st); - if (0 != ret) + ret = fstat (fd, &st); + if (ret < 0) { perror ("fstat"); return 80;