From: Rich Felker Date: Sat, 10 Aug 2013 00:04:05 +0000 (-0400) Subject: fix missing errno from exec failure in posix_spawn X-Git-Tag: v0.9.13~72 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=65d7aa4dfde9697b93d765f2f736e5f4a38bdfd5;p=oweals%2Fmusl.git fix missing errno from exec failure in posix_spawn failures prior to the exec attempt were reported correctly, but on exec failure, the return value contained junk. --- diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index 68cf795c..c6886526 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -105,6 +105,7 @@ static int child(void *args_vp) ? &attr->__mask : &args->oldmask, 0); args->exec(args->path, args->argv, args->envp); + ret = -errno; fail: /* Since sizeof errno < PIPE_BUF, the write is atomic. */