public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: Fix posix_spawn return code if clone fails (BZ#29109)
@ 2022-05-02 15:42 Adhemerval Zanella
  2022-05-06 13:43 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Adhemerval Zanella @ 2022-05-02 15:42 UTC (permalink / raw)
  To: libc-alpha

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);
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] linux: Fix posix_spawn return code if clone fails (BZ#29109)
  2022-05-02 15:42 [PATCH] linux: Fix posix_spawn return code if clone fails (BZ#29109) Adhemerval Zanella
@ 2022-05-06 13:43 ` Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2022-05-06 13:43 UTC (permalink / raw)
  To: libc-alpha

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);
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-06 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 15:42 [PATCH] linux: Fix posix_spawn return code if clone fails (BZ#29109) Adhemerval Zanella
2022-05-06 13:43 ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).