]> granicus.if.org Git - sudo/commitdiff
SVR5 systems return non-zero for success on socketpair(),
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 19 Feb 2011 13:13:17 +0000 (08:13 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 19 Feb 2011 13:13:17 +0000 (08:13 -0500)
check for -1 instead.  Closes Bug 469

src/exec.c

index cab657fe50a6b3ee484be2cad7114c3ccd72d0a7..70345962a479697eb5024b93c409a6bdc84f7566 100644 (file)
@@ -239,7 +239,7 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[],
      * We communicate with the child over a bi-directional pair of sockets.
      * Parent sends signal info to child and child sends back wait status.
      */
-    if (socketpair(PF_UNIX, SOCK_DGRAM, 0, sv) != 0)
+    if (socketpair(PF_UNIX, SOCK_DGRAM, 0, sv) == -1)
        error(1, "cannot create sockets");
 
     /*