From 3ca8ec19b6ecc8ae4413d0505ce2d0efdd3e52c8 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 10 May 2026 00:01:50 +0200 Subject: [PATCH] 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 11cdb5a29d0..faddb0d1494 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;