From a099aa7f2a26cf228620b347c404324d2c67ac4b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 19 Feb 2011 08:13:17 -0500 Subject: [PATCH] SVR5 systems return non-zero for success on socketpair(), check for -1 instead. Closes Bug 469 --- src/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exec.c b/src/exec.c index cab657fe5..70345962a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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"); /* -- 2.40.0