macros.pl: be a bit more careful with open()

Be a bit more strict with open() calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2008-09-09 09:43:16 -07:00
parent c357381da4
commit d4ca24338b

View File

@ -37,7 +37,7 @@ sub charcify(@) {
#
# Generate macros.c
#
open(OUT,">macros.c") or die "unable to open macros.c\n";
open(OUT,"> macros.c\0") or die "unable to open macros.c\n";
print OUT "/*\n";
print OUT " * Do not edit - this file auto-generated by macros.pl from:\n";
@ -60,7 +60,7 @@ my $lastname;
my $z;
foreach $fname ( @ARGV ) {
open(INPUT,$fname) or die "unable to open $fname\n";
open(INPUT,"< $fname\0") or die "$0: $fname: $!\n";
while (<INPUT>) {
$line++;
chomp;