From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 36BD33856DE7; Fri, 6 May 2022 14:08:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36BD33856DE7 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] linux: Fix posix_spawn return code if clone fails (BZ#29109) X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 050cc5f7c1fc30ae2a071282faed9b6a68ca95ba X-Git-Newrev: 71e2a681f18f617ab962bf8a139bd86d4d440e22 Message-Id: <20220506140828.36BD33856DE7@sourceware.org> Date: Fri, 6 May 2022 14:08:28 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 14:08:28 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=71e2a681f18f617ab962bf8a139bd86d4d440e22 commit 71e2a681f18f617ab962bf8a139bd86d4d440e22 Author: Adhemerval Zanella Date: Mon May 2 12:39:43 2022 -0300 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: --- 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);