X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fpopen.c;h=8448b7311d18049b185f686b2b92a2abb00fa527;hb=2954bc0b419e75fbfcf2b5081cb3e6e03a850049;hp=193efc0f36b27e42f70ed7026845312cba5c8fbb;hpb=486531339b7827b9d69df79a6a6ab8f427a3c650;p=netdata.git diff --git a/src/popen.c b/src/popen.c index 193efc0f..8448b731 100644 --- a/src/popen.c +++ b/src/popen.c @@ -138,7 +138,7 @@ FILE *mypopen(const char *command, pid_t *pidptr) error("pre-execution of command '%s' on pid %d: failed to set default signal handler for SIGUSR2.", command, getpid()); } - info("executing command: '%s' on pid %d.", command, getpid()); + debug(D_CHILDS, "executing command: '%s' on pid %d.", command, getpid()); execl("/bin/sh", "sh", "-c", command, NULL); exit(1); } @@ -147,6 +147,13 @@ int mypclose(FILE *fp, pid_t pid) { debug(D_EXIT, "Request to mypclose() on pid %d", pid); /*mypopen_del(fp);*/ + + // close the pipe fd + // this is required in musl + // without it the childs do not exit + close(fileno(fp)); + + // close the pipe file pointer fclose(fp); siginfo_t info;