skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit f7e8333c60883a93e3fd3eb52d761868b3234bf4
parent fb51953404b6ae56528294c7a40ad956b054abef
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Fri, 14 Sep 2018 22:38:28 +0000

 bugfix: child_spawn2 error path

Diffstat:
Msrc/libstddjb/child_spawn1_internal.c | 2+-
Msrc/libstddjb/child_spawn2.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libstddjb/child_spawn1_internal.c b/src/libstddjb/child_spawn1_internal.c @@ -103,7 +103,7 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con if ((to & 2) && (fd_copy(!(to & 1), to & 1) < 0)) goto err ; sig_blocknone() ; pathexec_run(prog, argv, envp) ; -err: + err: e = errno ; fd_write(syncp[1], (char *)&e, sizeof(e)) ; _exit(127) ; diff --git a/src/libstddjb/child_spawn2.c b/src/libstddjb/child_spawn2.c @@ -40,7 +40,7 @@ pid_t child_spawn2 (char const *prog, char const *const *argv, char const *const int e ; if (pipe(p[0]) < 0) return 0 ; if (ndelay_on(p[0][0]) < 0 || coe(p[0][0]) < 0 || pipe(p[1]) < 0) { e = errno ; goto errp ; } - if (ndelay_on(p[1][1]) < 0 || coe(p[1][1]) < 0) { e = errno ; goto errsp ; } + if (ndelay_on(p[1][1]) < 0 || coe(p[1][1]) < 0) { e = errno ; goto errp1 ; } #ifdef SKALIBS_HASPOSIXSPAWN