bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

passfd on glibc


From: Bruno Haible
Subject: passfd on glibc
Date: Sun, 13 Mar 2011 23:40:59 +0100
User-agent: KMail/1.9.9

After the passfd source code is written and polished and has a unit test,
now comes testing on various platforms.

The first one is a glibc system.  I get these warnings:

test-passfd.c: In function ‘main’:
test-passfd.c:81: warning: implicit declaration of function ‘waitpid’
test-passfd.c:103: warning: value computed is not used

This fixes it:


2011-03-13  Bruno Haible  <address@hidden>

        passfd test: Fix warnings.
        * tests/test-passfd.c: Include <sys/wait.h>.
        (main): Fix typo.

--- tests/test-passfd.c.orig    Sun Mar 13 23:34:20 2011
+++ tests/test-passfd.c Sun Mar 13 20:36:56 2011
@@ -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;
-- 
In memoriam Odette Sansom <http://en.wikipedia.org/wiki/Odette_Hallowes>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]