Make sure to exit with _exit from child
Exiting the child process with _exit after forking but before exec.
Change-Id: I5df34242c5444b6de6a559735074737d370a6a2e
diff --git a/logwrapper.c b/logwrapper.c
index 34a1e5a..6e47cb8 100644
--- a/logwrapper.c
+++ b/logwrapper.c
@@ -100,7 +100,7 @@
if (execv(argv_child[0], argv_child)) {
ALOG(LOG_ERROR, "logwrapper",
"executing %s failed: %s", argv_child[0], strerror(errno));
- exit(-1);
+ _exit(-1);
}
}
@@ -139,7 +139,7 @@
if (child_ptty < 0) {
close(parent_ptty);
ALOG(LOG_ERROR, "logwrapper", "Problem with child ptty");
- return -errno;
+ _exit(-errno);
}
// redirect stdout and stderr