From: Martin Q. <mqu...@us...> - 2005-02-23 23:08:25
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28732 Modified Files: flexml.pl Log Message: Get paranoid on file open()/close(). Should be enough to close patch #659746, which got lost Index: flexml.pl =================================================================== RCS file: /cvsroot/flexml/flexml/flexml.pl,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- flexml.pl 17 Feb 2005 22:14:32 -0000 1.43 +++ flexml.pl 23 Feb 2005 23:08:16 -0000 1.44 @@ -1046,7 +1046,7 @@ print STDOUT "Generating XML processor header in `$HEADER'.\n" if $verbose; - open HEADER, "+>$HEADER"; + open HEADER, "+>$HEADER" || die "$0: cannot write $HEADER: $!\n"; select HEADER; # Identification and license. @@ -1081,7 +1081,7 @@ print "#endif\n"; - close HEADER; + close HEADER || die "$0: cannot read $HEADER: $!\n"; } @@ -1095,10 +1095,10 @@ . ($opt{a} || $opt{A} ? " and application" : "") . " onto `$SCANNER'.\n" if $verbose; - open SCANNER, "+>$SCANNER"; + open SCANNER, "+>$SCANNER"|| die "$0: cannot write $SCANNER: $!\n"; select SCANNER; - open SKELETON; + open (SKELETON) || die "$0: cannot read $SKELETON: $!\n"; # Identification and license. print "/* Validating XML processor for $dtd" @@ -1483,8 +1483,10 @@ } - close SKELETON; - close SCANNER unless $opt{A}; + close SKELETON || die "$0: Cannot close $SKELETON: $!\n"; + unless ($opt{A}) { + close SCANNER || die "$0: Cannot close $SCANNER: $!\n"; + } } @@ -1498,7 +1500,7 @@ . ($opt{a} ? "" : " dummy") . " application onto `$APPLICATION'.\n" if $verbose; - open APPLICATION, "+>$APPLICATION"; + open APPLICATION, "+>$APPLICATION" || die "$0: Cannot write $APPLICATION: $!\n"; select APPLICATION; # Identification and license. @@ -1522,7 +1524,7 @@ # Get requested actions. if ($ACTIONS) { - open ACTIONS, "./flexml-act $ACTIONS|"; + open ACTIONS, "./flexml-act $ACTIONS|" || die "$0: Cannot exec ./flexml-act $ACTIONS: $!\n"; my ($tag,$attribute); my @myattributes; @@ -1597,7 +1599,7 @@ print $_; } - close ACTIONS; + close ACTIONS || die "$0: Cannot close pipe to flexml-act: $!\n"; print "\n"; } @@ -1607,10 +1609,10 @@ } if ($opt{D}) { - close APPLICATION; + close APPLICATION || die "$0: Cannot close $APPLICATION: $!\n"; } elsif ($opt{A}) { - close SCANNER; + close SCANNER || die "$0: Cannot close $SCANNER: $!\n"; } |