]> 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:12:46 +0000 (08:12 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 19 Feb 2011 13:12:46 +0000 (08:12 -0500)
check for -1 instead.  Closes Bug 469

--HG--
branch : 1.7

exec.c

diff --git a/exec.c b/exec.c
index 1fca0ffc5964ac0957073cdc219a3dff03aae52e..65a3abefb7a8f7c0615b73d037a18492fafa36bd 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -268,7 +268,7 @@ sudo_execve(path, argv, envp, uid, cstat, dowait, bgmode)
      * 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");
 
     /*