git: 3ca8ec19b6ec - main - libc: correct posix_spawn_file_actions_init ENOMEM error

From: Jilles Tjoelker <jilles_at_FreeBSD.org>
Date: Sat, 09 May 2026 22:03:38 UTC
The branch main has been updated by jilles:

URL: https://cgit.FreeBSD.org/src/commit/?id=3ca8ec19b6ecc8ae4413d0505ce2d0efdd3e52c8

commit 3ca8ec19b6ecc8ae4413d0505ce2d0efdd3e52c8
Author:     Jilles Tjoelker <jilles@FreeBSD.org>
AuthorDate: 2026-05-09 22:01:50 +0000
Commit:     Jilles Tjoelker <jilles@FreeBSD.org>
CommitDate: 2026-05-09 22:02:25 +0000

    libc: correct posix_spawn_file_actions_init ENOMEM error
    
    The return value of posix_spawn_file_actions_init() is an error number.
    
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D56911
---
 lib/libc/gen/posix_spawn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c
index 11cdb5a29d03..faddb0d1494f 100644
--- a/lib/libc/gen/posix_spawn.c
+++ b/lib/libc/gen/posix_spawn.c
@@ -424,7 +424,7 @@ posix_spawn_file_actions_init(posix_spawn_file_actions_t *ret)
 
 	fa = malloc(sizeof(struct __posix_spawn_file_actions));
 	if (fa == NULL)
-		return (-1);
+		return (errno);
 
 	STAILQ_INIT(&fa->fa_list);
 	*ret = fa;