diff options
author | Daniel Black <danielgb@au.ibm.com> | 2018-02-25 15:25:54 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-25 15:25:54 +1100 |
commit | 0805a9565f09a36104a420d9e229e44b1eea8879 (patch) | |
tree | 5c5dbf942479c2b7349f1b4505768ddf5a2f8b8d /mysql-test/lib/My/SafeProcess/Base.pm | |
parent | 3188131b15c26509e4df3c4b15972d07a20be8bd (diff) | |
parent | 8936b175106a3fdfc560e9d33aa58a6372084c5f (diff) | |
download | mariadb-git-0805a9565f09a36104a420d9e229e44b1eea8879.tar.gz |
Merge branch '10.3' into 10.2-MDEV-10814-dont-dump-query-cache
Diffstat (limited to 'mysql-test/lib/My/SafeProcess/Base.pm')
-rw-r--r-- | mysql-test/lib/My/SafeProcess/Base.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm index 1ac0120a735..c5ac2ab51c2 100644 --- a/mysql-test/lib/My/SafeProcess/Base.pm +++ b/mysql-test/lib/My/SafeProcess/Base.pm @@ -186,8 +186,10 @@ sub create_process { # it and any childs(that hasn't changed group themself) setpgrp(0,0) if $opts{setpgrp}; - if ( $output and !open(STDOUT, $open_mode, $output) ) { - croak("can't redirect STDOUT to '$output': $!"); + if ( $output ) { + close STDOUT; + open(STDOUT, $open_mode, $output) + or croak "can't redirect STDOUT to '$output': $!"; } if ( $error ) { @@ -196,8 +198,10 @@ sub create_process { croak("can't dup STDOUT: $!"); } } - elsif ( ! open(STDERR, $open_mode, $error) ) { - croak("can't redirect STDERR to '$error': $!"); + else { + close STDERR; + open(STDERR, $open_mode, $error) + or croak "can't redirect STDERR to '$error': $!"; } } |