When the child process exited without producing output (for example
because usign was not found), the parent process would hang forever in
read(). By closing the writing end early in the parent process, read
will return as soon as no writing FDs are left - that is, when the child
process has exited.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
_exit(1);
}
+ close(fds[1]);
+
waitpid(pid, &status, 0);
status = WEXITSTATUS(status);
if (fingerprint && !WEXITSTATUS(status)) {
}
close(fds[0]);
- close(fds[1]);
return status;
}