Skip to content

Commit

Permalink
Item12471: Fix test of 3-argument open
Browse files Browse the repository at this point in the history
Also make sure that an "insane" system is reported to the user
immediately.

Minor Tidy change also applied.

git-svn-id: http://svn.foswiki.org/branches/Release01x01@16653 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Apr 10, 2013
1 parent 0fbd246 commit dc11c06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions core/bin/configure
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ if ($@) {
# Run command without stderr output, to avoid CGI giving error.
# Get names of primary and other groups.
# This is down here because it takes 30s to execute on Strawberry perl
$::WebServer_gid = lc(qx(sh -c '( id -un ; id -gn) 2>/dev/null' 2>nul ) || 'n/a');
$::WebServer_gid =
lc( qx(sh -c '( id -un ; id -gn) 2>/dev/null' 2>nul ) || 'n/a' );
}

###########################################################
Expand Down Expand Up @@ -454,7 +455,7 @@ sub _dispatchContents {
# Dispatcher methods return a boolean to indicate whether to generate a
# link back to the main page at the end.

if ( $insane && $query->param('abort') ) {
if ( $insane || $query->param('abort') ) {
print $sanityStatement;
}
else {
Expand Down
8 changes: 4 additions & 4 deletions core/lib/Foswiki/Configure/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ sub checkCanCreateFile {
return File::Spec->catfile( @path, '' ) . ' is not writable';
}
my $txt1 = "test 1 2 3";
open my $fh, '>', $name
|| return 'Could not create test file ' . $name . ':' . $!;
open( my $fh, '>', $name )
or return 'Could not create test file ' . $name . ':' . $!;
print $fh $txt1;
close($fh);
open my $in_file, '<', $name
|| return 'Could not read test file ' . $name . ':' . $!;
open( my $in_file, '<', $name )
or return 'Could not read test file ' . $name . ':' . $!;
my $txt2 = <$in_file>;
close($in_file);
unlink $name if ( -e $name );
Expand Down

0 comments on commit dc11c06

Please sign in to comment.