From: Bruno Haible Date: Sun, 13 Mar 2011 22:40:23 +0000 (+0100) Subject: passfd test: Fix warnings. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00b9c8e79b4904139d7bb721b5ba175e591dfb34;p=pspp passfd test: Fix warnings. * tests/test-passfd.c: Include . (main): Fix typo. --- diff --git a/tests/test-passfd.c b/tests/test-passfd.c index ca46266d55..20489348b1 100644 --- a/tests/test-passfd.c +++ b/tests/test-passfd.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "macros.h" @@ -86,8 +87,7 @@ main () } 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 @@ main () } /* try to stat new fd */ - ret == fstat (fd, &st); - if (0 != ret) + ret = fstat (fd, &st); + if (ret < 0) { perror ("fstat"); return 80;