diff options
Diffstat (limited to 'src/usr/errl/parser/genErrlParsers.pl')
| -rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index 7fb516683..a2ec5f08c 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -1052,14 +1052,14 @@ close(OFILE); # because this is actually part of hostboot. #------------------------------------------------------------------------------ $outputFileName = $outputDir . "/../errldisplaydata.C"; -open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!"); +open(OFILE, ">", $outputFileName . ".tmp") or + die("Cannot open: $outputFileName.tmp: $!"); print OFILE "/*\n"; print OFILE " * Automatically generated by Hostboot's $0\n"; print OFILE " * Do not modify this file in the hostboot tree, it is automatically\n"; print OFILE " * generated every build.\n"; print OFILE " *\n"; -print OFILE " * TimeStamp: $timestamp\n"; print OFILE " * Image Id: $imageId\n"; print OFILE " *\n"; print OFILE " */\n\n"; @@ -1091,6 +1091,18 @@ print OFILE "uint16_t ErrLogDisplay::compTableSize = sizeof(compTable) / sizeof( print OFILE "} // End Namespace\n"; close(OFILE); +use File::Compare; +use File::Copy; + +if (compare($outputFileName . ".tmp", $outputFileName) != 0) { + move($outputFileName . ".tmp", $outputFileName) or + die("Cannot move $outputFileName.tmp to $outputFileName: $!"); +} +else +{ + unlink $outputFileName . ".tmp"; +} + #------------------------------------------------------------------------------ # Subroutine that prints the usage #------------------------------------------------------------------------------ |

