linux: Fix posix_spawn return code if clone fails (BZ#29109)
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
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(-)
Comments
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);
>
@@ -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);