summaryrefslogtreecommitdiff
path: root/src/libstddjb/child_spawn1_internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/child_spawn1_internal.c')
-rw-r--r--src/libstddjb/child_spawn1_internal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstddjb/child_spawn1_internal.c b/src/libstddjb/child_spawn1_internal.c
index f833a15..8bd1678 100644
--- a/src/libstddjb/child_spawn1_internal.c
+++ b/src/libstddjb/child_spawn1_internal.c
@@ -66,7 +66,9 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con
#else
+#include <string.h>
#include <skalibs/allreadwrite.h>
+#include <skalibs/strerr2.h>
#include <skalibs/sig.h>
pid_t child_spawn1_internal (char const *prog, char const *const *argv, char const *const *envp, int *p, int to)
@@ -95,6 +97,11 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con
}
if (!pid)
{
+ size_t len = strlen(PROG) ;
+ char name[len + 9] ;
+ memcpy(name, PROG, len) ;
+ memcpy(name + len, " (child)", 9) ;
+ PROG = name ;
fd_close(syncp[0]) ;
fd_close(p[!(to & 1)]) ;
if (fd_move(to & 1, p[to & 1]) < 0) goto err ;