diff options
author | David Lawrence <dkl@mozilla.com> | 2015-01-27 05:27:50 +0100 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-01-27 05:27:50 +0100 |
commit | 90244813fe8110fc91f3746ebd93880e1c911cf1 (patch) | |
tree | 34ff732e860855956f043d0a41db8b2f30ef0095 /testserver.pl | |
parent | a748745d3eb9110b0c6bcd803d8d86db8951ad43 (diff) | |
download | bugzilla-90244813fe8110fc91f3746ebd93880e1c911cf1.tar.gz bugzilla-90244813fe8110fc91f3746ebd93880e1c911cf1.tar.xz |
Bug 1124432: Backport upstream bug 1079065 to bmo/4.2 to fix improper use of open() calls
Diffstat (limited to 'testserver.pl')
-rwxr-xr-x | testserver.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testserver.pl b/testserver.pl index 3142685bc..ffe4b1ad5 100755 --- a/testserver.pl +++ b/testserver.pl @@ -44,7 +44,7 @@ my @pscmds = ('ps -eo comm,gid', 'ps -acxo command,gid', 'ps -acxo command,rgid' my $sgid = 0; if (!ON_WINDOWS) { foreach my $pscmd (@pscmds) { - open PH, "$pscmd 2>/dev/null |"; + open PH, '-|', "$pscmd 2>/dev/null"; while (my $line = <PH>) { if ($line =~ /^(?:\S*\/)?(?:httpd|apache)2?\s+(\d+)$/) { $sgid = $1 if $1 > $sgid; @@ -271,7 +271,7 @@ sub check_image { sub create_file { my ($filename, $content) = @_; - open(FH, ">$filename") + open(FH, ">", $filename) or die "Failed to create $filename: $!\n"; binmode FH; print FH $content; @@ -280,7 +280,7 @@ sub create_file { sub read_file { my ($filename) = @_; - open(FH, $filename) + open(FH, "<", $filename) or die "Failed to open $filename: $!\n"; binmode FH; my $content = <FH>; |