From a646c96d5f7ec4b4e0bb538a41fc202c2cdb3309 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 8 Sep 2023 08:03:58 +0000 Subject: Make child_spawn_workaround public Signed-off-by: Laurent Bercot --- src/libstddjb/child_spawn_workaround.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/libstddjb/child_spawn_workaround.c') diff --git a/src/libstddjb/child_spawn_workaround.c b/src/libstddjb/child_spawn_workaround.c index 516ade5..b5fb4f0 100644 --- a/src/libstddjb/child_spawn_workaround.c +++ b/src/libstddjb/child_spawn_workaround.c @@ -1,6 +1,7 @@ /* ISC license. */ #include +#include #if defined(SKALIBS_HASPOSIXSPAWN) && defined(SKALIBS_HASPOSIXSPAWNEARLYRETURN) @@ -9,8 +10,8 @@ #include #include -#include -#include "child_spawn-internal.h" + + /* when posix_spawn returns too early, you need this */ pid_t child_spawn_workaround (pid_t pid, int const *p) { @@ -41,8 +42,14 @@ pid_t child_spawn_workaround (pid_t pid, int const *p) #else - /* avoid empty TUs */ - -extern int skalibs_child_spawn_workaround_dummy_ ; +pid_t child_spawn_workaround (pid_t pid, int const *p) +{ + if (p) + { + fd_close(p[1]) ; + fd_close(p[0]) ; + } + return pid ; +} #endif -- cgit v1.3.1