diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-05-04 19:07:29 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-05-04 19:07:29 +0200 |
| commit | 5e0f7123b91acc6669e8373bb3390c881a6a7fd2 (patch) | |
| tree | be12f436518fcde7ebbe91f1d23d33e02dcfe229 | |
| parent | List blind-translate and blind-skip-pattern in list of commands (diff) | |
| download | blind-5e0f7123b91acc6669e8373bb3390c881a6a7fd2.tar.gz blind-5e0f7123b91acc6669e8373bb3390c881a6a7fd2.tar.bz2 blind-5e0f7123b91acc6669e8373bb3390c881a6a7fd2.tar.xz | |
Fix enjoin_jobs
Signed-off-by: Mattias Andrée <maandree@kth.se>
| -rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -215,14 +215,14 @@ enjoin_jobs(int status, int is_master, pid_t *pids) int stat; size_t i; if (!is_master) - exit(0); + free(pids), exit(0); if (!pids) return; for (i = 0; pids[i] != -1; i++) { if (waitpid(pids[i], &stat, 0) == -1) enprintf(status, "waitpid:"); - if (status) - exit(WIFEXITED(status) ? WEXITSTATUS(status) : WTERMSIG(status)); + if (stat) + exit(WIFEXITED(stat) ? WEXITSTATUS(stat) : WTERMSIG(stat)); } free(pids); } |
