diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-19 14:49:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-19 14:49:36 +0000 |
commit | 4710960f1314ec790ea876f0e50250cac59e089c (patch) | |
tree | ebf7ffacad519615bc779e28e108af7fff27d14b /perl-install/run_program.pm | |
parent | bb1b2617bc36e258f13d375faaaec1bfff97080e (diff) | |
download | drakx-backup-do-not-use-4710960f1314ec790ea876f0e50250cac59e089c.tar drakx-backup-do-not-use-4710960f1314ec790ea876f0e50250cac59e089c.tar.gz drakx-backup-do-not-use-4710960f1314ec790ea876f0e50250cac59e089c.tar.bz2 drakx-backup-do-not-use-4710960f1314ec790ea876f0e50250cac59e089c.tar.xz drakx-backup-do-not-use-4710960f1314ec790ea876f0e50250cac59e089c.zip |
no_comment
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 617c6ebd5..b36c8744b 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -17,10 +17,17 @@ sub rooted { fork and wait, return $? == 0; { + my ($stdout, $stdoutm); + ($stdoutm, $stdout, @args) = @args if $args[0] eq ">" || $args[0] eq ">>"; + open STDIN, "/dev/null" or die "can't open /dev/null as stdin"; - open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "runProgramRoot can't log :("; - open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "runProgramRoot can't log :("; + open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "run_program can't log :("; + if ($stdout) { + open STDOUT, "$stdoutm $root$stdout" or die "run_program can't output in $root$stdout (mode `$stdoutm')"; + } else { + open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "run_program can't log :("; + } $root and chroot $root; chdir "/"; |