From: Adhemerval Zanella Date: Mon, 2 May 2022 15:39:43 +0000 (-0300) Subject: linux: Fix posix_spawn return code if clone fails (BZ#29109) X-Git-Tag: glibc-2.36~306 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71e2a681f18f617ab962bf8a139bd86d4d440e22;p=thirdparty%2Fglibc.git 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. --- diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index d703485e3fb..d6f5ca89cdd 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);