[PATCH] Resend tools/winemaker doesn't check for open return code

Colin Pitrat colin.pitrat at bull.net
Tue Aug 8 05:19:31 CDT 2006


Forgot the attachment !

Colin Pitrat (Bull Services Telco)
Bull,  Architect of an Open World (TM)
Tél : +33 (0)  1 30 80 72 93
www.bull.com


Colin Pitrat wrote:
> Hi,
> here is a version of the patch that corrects many perl scripts 
> (including the previous msvcmaker) at the same time. Tell me if I should 
> resent it in several patches.
> 
> Regards,
> 
> Colin Pitrat (Bull Services Telco)
> Bull,  Architect of an Open World (TM)
> Tél : +33 (0)  1 30 80 72 93
> www.bull.com
> 
> 
> 
-------------- next part --------------
diff -u -r1.26 bug_report.pl
--- wine/tools/bug_report.pl	23 May 2006 12:49:36 -0000	1.26
+++ wine/tools/bug_report.pl	8 Aug 2006 10:10:50 -0000
@@ -45,7 +45,7 @@
 	$var =~ s/\t//g;
 	return $var;
 }
-open STDERR, ">&SAVEERR"; open STDERR, ">&STDOUT";
+open(STDERR, ">&SAVEERR"); open(STDERR, ">&STDOUT");
 $ENV{'SHELL'}="/bin/bash";
 my $var0 = qq{
 	What is your level of Wine expertise? 1-newbie 2-intermediate 3-advanced
@@ -530,7 +530,7 @@
 		}
 	}
 	unlink($tmpoutfile);
-	open(OUTFILE, "$outfile");
+	open(OUTFILE, "$outfile") || die "Error: Can't open $outfile: $!\n";
 	while (<OUTFILE>) {
 		$lastlines .= $_;
 	}
@@ -550,7 +550,7 @@
 	system("$wineloc WINEDEBUG=$debugopts $extraops \"$program\"");
 }
 sub generate_outfile() {
-open(OUTFILE,">$outfile");
+open(OUTFILE,">$outfile") || die "Error: Can't open $outfile: $!\n";
 print OUTFILE <<EOM;
 Auto-generated debug report by Wine Quick Debug Report Maker Tool:
 WINE Version:                $winever
diff -u -r1.7 make_authors
--- wine/tools/make_authors	23 May 2006 12:49:36 -0000	1.7
+++ wine/tools/make_authors	8 Aug 2006 10:10:50 -0000
@@ -22,7 +22,7 @@
 
 my @authors;
 open(AUTHORS,"<AUTHORS") or die "Can't open AUTHORS";
-open(NEWAUTHORS,">AUTHORS.new");
+open(NEWAUTHORS,">AUTHORS.new") or die "Can't open AUTHORS.new";
 while(<AUTHORS>)
   {
     print NEWAUTHORS;
diff -u -r1.21 config.pm
--- wine/tools/winapi/config.pm	23 May 2006 12:49:37 -0000	1.21
+++ wine/tools/winapi/config.pm	8 Aug 2006 10:10:51 -0000
@@ -155,7 +155,7 @@
 
     my @dirs = ($dir);
     while(defined(my $dir = shift @dirs)) {
-	opendir(DIR, $dir);
+	opendir(DIR, $dir) || die "Can't open directory $dir: $!\n";
 	my @entries= readdir(DIR);
 	closedir(DIR);
 	foreach (@entries) {
diff -u -r1.7 make_filter
--- wine/tools/winapi/make_filter	23 May 2006 12:49:37 -0000	1.7
+++ wine/tools/winapi/make_filter	8 Aug 2006 10:10:51 -0000
@@ -44,7 +44,7 @@
 ########################################################################
 
 my $command = $options->make . " " . join(" ", $options->arguments);
-open(IN, "($command) 2>&1 |");
+open(IN, "($command) 2>&1 |") || die "Cannot execute command $command: $!";
 
 while(<IN>) {
     chomp;
diff -u -r1.40 msvcmaker
--- wine/tools/winapi/msvcmaker	6 Jan 2006 12:19:45 -0000	1.40
+++ wine/tools/winapi/msvcmaker	8 Aug 2006 10:10:51 -0000
@@ -45,7 +45,7 @@
 
     my $type = "win32";
 
-    open(IN, "< $wine_dir/$spec_file");
+    open(IN, "< $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
     my $header = 1;
     my $lookahead = 0;
@@ -115,7 +115,7 @@
 my %wine_test_dsp_files;
 
 MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
-    open(IN, "< $wine_dir/$makefile_in_file");
+    open(IN, "< $wine_dir/$makefile_in_file") || die "Error: Can't open $wine_dir/$makefile_in_file: $!\n";
 
     my $topobjdir;
     my $module;
diff -u -r1.4 nativeapi.pm
--- wine/tools/winapi/nativeapi.pm	23 May 2006 12:49:37 -0000	1.4
+++ wine/tools/winapi/nativeapi.pm	8 Aug 2006 10:10:51 -0000
@@ -59,7 +59,7 @@
 
     $output->progress("$api_file");
 
-    open(IN, "< $api_file");
+    open(IN, "< $api_file") || die "Error: Can't open $api_file: $!\n";
     local $/ = "\n";
     while(<IN>) {
 	s/^\s*(.*?)\s*$/$1/; # remove whitespace at begin and end of line
@@ -73,7 +73,7 @@
     $output->progress("$configure_ac_file");
 
     my $again = 0;
-    open(IN, "< $configure_ac_file");
+    open(IN, "< $configure_ac_file") || die "Error: Can't open $configure_ac_file: $!\n";
     local $/ = "\n";
     while($again || (defined($_ = <IN>))) {
 	$again = 0;
@@ -141,7 +141,7 @@
 
     $output->progress("$config_h_in_file");
 
-    open(IN, "< $config_h_in_file");
+    open(IN, "< $config_h_in_file") || die "Error: Can't open $config_h_in_file: $!\n";
     local $/ = "\n";
     while(<IN>) {
 	# remove leading and trailing whitespace
diff -u -r1.12 winapi_check
--- wine/tools/winapi/winapi_check	23 May 2006 12:49:37 -0000	1.12
+++ wine/tools/winapi/winapi_check	8 Aug 2006 10:10:51 -0000
@@ -82,7 +82,7 @@
 
 	$include2info{$file} = { name => $file };
 
-	open(IN, "< $wine_dir/$file");
+	open(IN, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
 	while(<IN>) {
 	    if(/^\s*\#\s*include\s*\"(.*?)\"/) {
 		my $header = $1;
diff -u -r1.27 winapi_extract
--- wine/tools/winapi/winapi_extract	23 May 2006 12:49:37 -0000	1.27
+++ wine/tools/winapi/winapi_extract	8 Aug 2006 10:10:52 -0000
@@ -63,7 +63,7 @@
 
 	my $type = "win32";
 
-	open(IN, "< $wine_dir/$spec_file");
+	open(IN, "< $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
 	my $header = 1;
 	my $lookahead = 0;
@@ -210,7 +210,7 @@
     $progress_current++;
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
@@ -463,7 +463,7 @@
 	    $spec_file .= "2";
 
 	    $output->progress("$spec_file");
-	    open(OUT, "> $wine_dir/$spec_file");
+	    open(OUT, "> $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
 	    if(exists($specifications{$module}{init})) {
 		my $function = $specifications{$module}{init}{function};
@@ -666,7 +666,7 @@
 	    next if $external_name eq "\@";
 
 	    if($n == 0) {
-                open(OUT, "> $wine_dir/programs/winetest/include/${package}.pm");
+                open(OUT, "> $wine_dir/programs/winetest/include/${package}.pm") || die "Error: Can't open $wine_dir/programs/winetest/include/${package}.pm: $!\n";
 
                 print OUT "package ${package};\n";
                 print OUT "\n";
diff -u -r1.21 winapi_fixup
--- wine/tools/winapi/winapi_fixup	23 May 2006 12:49:37 -0000	1.21
+++ wine/tools/winapi/winapi_fixup	8 Aug 2006 10:10:52 -0000
@@ -61,7 +61,7 @@
     $output->prefix("$file:");
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff -u -r1.7 winapi_module_user.pm
--- wine/tools/winapi/winapi_module_user.pm	23 May 2006 12:49:37 -0000	1.7
+++ wine/tools/winapi/winapi_module_user.pm	8 Aug 2006 10:10:52 -0000
@@ -626,7 +626,7 @@
     my $found_comment = shift;
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff -u -r1.23 winapi_test
--- wine/tools/winapi/winapi_test	23 May 2006 12:49:37 -0000	1.23
+++ wine/tools/winapi/winapi_test	8 Aug 2006 10:10:53 -0000
@@ -81,7 +81,7 @@
 
     $file .= "2"; # FIXME: For tests
 
-    open(OUT, "> $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
+    open(OUT, "> $winapi_dir/$file") || die "Error: Can't open $winapi_dir/$file: $!\n";
 
     my $x = 0;
     my @test_dirs = $tests->get_test_dirs();
@@ -337,7 +337,7 @@
     $progress_current++;
 
     {
-	open(IN, "< $wine_dir/$file");
+	open(IN, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff -u -r1.7 function_grep.pl
--- wine/tools/winedump/function_grep.pl	23 May 2006 12:49:39 -0000	1.7
+++ wine/tools/winedump/function_grep.pl	8 Aug 2006 10:10:53 -0000
@@ -54,7 +54,7 @@
 }
 
 foreach my $file (@files) {
-    open(IN, "< $file");
+    open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 
     my $level = 0;
     my $extern_c = 0;


More information about the wine-patches mailing list