From 71e2a681f18f617ab962bf8a139bd86d4d440e22 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 2 May 2022 12:39:43 -0300 Subject: 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. --- sysdeps/unix/sysv/linux/spawni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/spawni.c') 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); -- cgit v1.2.3-70-g09d2