STDOUT and $psync[1] are the same here, so no need to differ.
Also we do this only for letting the parent know tha we're ready, the
parent knows the UPID already as it was generated before forking.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
}
# sync with parent (signal that we are ready)
}
# sync with parent (signal that we are ready)
- if ($sync) {
- print "$upid\n";
- } else {
- POSIX::write($psync[1], $upid, length ($upid));
- POSIX::close($psync[1]);
- }
+ POSIX::write($psync[1], $upid, length ($upid));
+ POSIX::close($psync[1]) if !$sync; # don't need output pipe if async
my $readbuf = '';
# sync with parent (wait until parent is ready)
my $readbuf = '';
# sync with parent (wait until parent is ready)