summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-08-09 20:04:05 -0400
committerRich Felker <dalias@aerifal.cx>2013-08-09 20:04:05 -0400
commit65d7aa4dfde9697b93d765f2f736e5f4a38bdfd5 (patch)
treeab9a58e103f22c61795eeb2d4e247e815c302ca1 /src
parent9848e64819ce31787085a3d44df628bdf1091792 (diff)
downloadmusl-65d7aa4dfde9697b93d765f2f736e5f4a38bdfd5.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/process/posix_spawn.c1
1 files changed, 1 insertions, 0 deletions
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. */