projects
/
pve-access-control.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
527b2e7
)
do not close STDIN if rune in foreground
author
Dietmar Maurer
<dietmar@proxmox.com>
Wed, 19 Oct 2011 05:30:44 +0000
(07:30 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Wed, 19 Oct 2011 05:30:44 +0000
(07:30 +0200)
PVE/RPCEnvironment.pm
patch
|
blob
|
blame
|
history
diff --git
a/PVE/RPCEnvironment.pm
b/PVE/RPCEnvironment.pm
index 5806107d9e7eb4a0546b503809e371dd170db854..4cacd520f3c8261d1e28d068d110ad17f8ed7f00 100644
(file)
--- a/
PVE/RPCEnvironment.pm
+++ b/
PVE/RPCEnvironment.pm
@@
-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);