diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-09-08 08:03:58 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2023-09-08 08:03:58 +0000 |
| commit | a646c96d5f7ec4b4e0bb538a41fc202c2cdb3309 (patch) | |
| tree | a5260aa8fe9c4f1ee2772d318024b5cb208f9bf2 /src/libstddjb/child_spawn_workaround.c | |
| parent | 1f2d5f95684e93f8523e369ef1fed7a75c444082 (diff) | |
| download | skalibs-a646c96d5f7ec4b4e0bb538a41fc202c2cdb3309.tar.gz | |
Make child_spawn_workaround public
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/child_spawn_workaround.c')
| -rw-r--r-- | src/libstddjb/child_spawn_workaround.c | 17 |
1 files changed, 12 insertions, 5 deletions
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 <skalibs/sysdeps.h> +#include <skalibs/djbunix.h> #if defined(SKALIBS_HASPOSIXSPAWN) && defined(SKALIBS_HASPOSIXSPAWNEARLYRETURN) @@ -9,8 +10,8 @@ #include <sys/wait.h> #include <skalibs/allreadwrite.h> -#include <skalibs/djbunix.h> -#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 |
