SVR5 systems return non-zero for success on socketpair(),

check for -1 instead.  Closes Bug 469
This commit is contained in:
Todd C. Miller
2011-02-19 08:13:17 -05:00
parent 554833c587
commit a099aa7f2a

View 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");
/*