Message ID | 20220502154233.4007963-1-adhemerval.zanella@linaro.org |
---|---|
State | New |
Headers | show |
Series | linux: Fix posix_spawn return code if clone fails (BZ#29109) | expand |
I will commit this shortly if no one opposes it. On 02/05/2022 12:42, Adhemerval Zanella wrote: > 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(-) > > 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); >
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);