summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index eb6a0a533..5bfd0352a 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -58,8 +58,13 @@ sub raw {
}
$ENV{HOME} || $::isInstall or $ENV{HOME} = '/root';
- my $stdout = $stdout_raw && (ref($stdout_raw) ? "$ENV{HOME}/tmp/.drakx-stdout.$$" : "$root$stdout_raw");
- my $stderr = $stderr_raw && (ref($stderr_raw) ? "$ENV{HOME}/tmp/.drakx-stderr.$$" : "$root$stderr_raw");
+ my $tmpdir = sub {
+ my $dir = "$ENV{HOME}/tmp";
+ -d $dir or mkdir($dir, 0700);
+ $dir;
+ };
+ my $stdout = $stdout_raw && (ref($stdout_raw) ? $tmpdir->() . "/.drakx-stdout.$$" : "$root$stdout_raw");
+ my $stderr = $stderr_raw && (ref($stderr_raw) ? $tmpdir->() . "/.drakx-stderr.$$" : "$root$stderr_raw");
if (my $pid = fork()) {
if ($options->{detach}) {