summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-12-09 22:08:27 -0800
committerMichael Forney <mforney@mforney.org>2016-12-10 11:56:37 -0800
commitf5ce61b14a53a3e49665473bd2ec5538168b5597 (patch)
tree69b96c99ef729d46bde1e3bafe987437e3cd5094 /util
parent361439382a2973f7f42548c919a3667bec90c74e (diff)
perms-hook: posix_spawn functions return error number
Diffstat (limited to 'util')
-rw-r--r--util/perms-hook.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/perms-hook.c b/util/perms-hook.c
index db2fd1df..cc885bef 100644
--- a/util/perms-hook.c
+++ b/util/perms-hook.c
@@ -87,13 +87,13 @@ spawn(char **argv, pid_t *pid)
f = fdopen(fd[0], "r");
if (!f)
die("fdopen:");
- if (posix_spawn_file_actions_init(&actions) < 0)
+ if ((errno = posix_spawn_file_actions_init(&actions)) > 0)
die("posix_spawn_file_actions_init:");
- if (posix_spawn_file_actions_addclose(&actions, fd[0]) < 0)
+ if ((errno = posix_spawn_file_actions_addclose(&actions, fd[0])) > 0)
die("posix_spawn_file_actions_adddup2:");
- if (posix_spawn_file_actions_adddup2(&actions, fd[1], 1) < 0)
+ if ((errno = posix_spawn_file_actions_adddup2(&actions, fd[1], 1)) > 0)
die("posix_spawn_file_actions_adddup2:");
- if (posix_spawnp(pid, argv[0], &actions, NULL, argv, environ) < 0)
+ if ((errno = posix_spawnp(pid, argv[0], &actions, NULL, argv, environ)) > 0)
die("posix_spawnp:");
posix_spawn_file_actions_destroy(&actions);
close(fd[1]);