summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-05-02 12:39:43 -0300
committerAndreas K. Hüttel <dilfridge@gentoo.org>2022-05-14 23:32:15 +0200
commit3a90182bc0b309cb74a46bb05dfd34ae20321818 (patch)
treee65c88f110708c699eaffacde597a4b7f832d4b2
parentx86: Fix fallback for wcsncmp_avx2 in strcmp-avx2.S [BZ #28896] (diff)
downloadglibc-3a90182bc0b309cb74a46bb05dfd34ae20321818.tar.gz
glibc-3a90182bc0b309cb74a46bb05dfd34ae20321818.tar.bz2
glibc-3a90182bc0b309cb74a46bb05dfd34ae20321818.zip
linux: Fix posix_spawn return code if clone fails (BZ#29109)
The __clone_internal returns the error on errno. Checked on x86_64-linux-gnu. (cherry picked from commit 71e2a681f18f617ab962bf8a139bd86d4d440e22) (cherry picked from commit 5c0d94d780598a298c9e8685fd811fab9664c368)
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index d703485e3f..d6f5ca89cd 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -409,7 +409,7 @@ __spawnix (pid_t * pid, const char *file,
__waitpid (new_pid, NULL, 0);
}
else
- ec = -new_pid;
+ ec = errno;
__munmap (stack, stack_size);