5
0
mirror of git://git.proxmox.com/git/pve-access-control.git synced 2025-01-03 01:17:55 +03:00

do not close STDIN if rune in foreground

This commit is contained in:
Dietmar Maurer 2011-10-19 07:30:44 +02:00
parent 527b2e7aed
commit 5a941ebef2

View File

@ -531,13 +531,17 @@ sub fork_worker {
# same algorythm as used inside SA
# STDIN = /dev/null
my $fd = fileno (STDIN);
close STDIN;
POSIX::close(0) if $fd != 0;
die "unable to redirect STDIN - $!"
if !open(STDIN, "</dev/null");
if (!$sync) {
close STDIN;
POSIX::close(0) if $fd != 0;
die "unable to redirect STDIN - $!"
if !open(STDIN, "</dev/null");
$outfh = PVE::Tools::upid_open($upid);
}
$outfh = PVE::Tools::upid_open($upid) if !$sync;
# redirect STDOUT
$fd = fileno(STDOUT);