The comment contained a typo ("taged") and vaguely referred to "one of
the parameters" without explaining what actually happens: the child
calls exit(0) for early-exit paths such as --help and --version, and
the parent detects this by checking for a clean exit with no pipe data.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
int status;
waitpid(worker, &status, 0);
- // One of the parameters was taged as exit(0) in the child process
- // so we need to check if we should exit here
+ // child exited via exit(0) for early-exit paths (e.g. --help, --version)
if (!have_data && WIFEXITED(status) && WEXITSTATUS(status) == 0) {
exit(0);
}