File tree 2 files changed +4
-23
lines changed
2 files changed +4
-23
lines changed Original file line number Diff line number Diff line change 7
7
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
8
8
# Portions Copyright (c) 1994, Regents of the University of California
9
9
#
10
- # $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.1 2010/01/05 01:06:56 tgl Exp $
10
+ # $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.2 2010/01/05 02:34:03 tgl Exp $
11
11
#
12
12
# ----------------------------------------------------------------------
13
13
@@ -169,31 +169,12 @@ sub Catalogs
169
169
return \%catalogs ;
170
170
}
171
171
172
- # Rename temporary files to final names, if anything has changed .
172
+ # Rename temporary files to final names.
173
173
# Call this function with the final file name --- we append .tmp automatically
174
174
sub RenameTempFile
175
175
{
176
176
my $final_name = shift ;
177
177
my $temp_name = $final_name . ' .tmp' ;
178
- if (-e $final_name && -s $temp_name == -s $final_name )
179
- {
180
- open TN, ' <' , " $temp_name " || die " $temp_name : $! " ;
181
- if (open FN, ' <' , $final_name )
182
- {
183
- local $/ = undef ;
184
- my $tn = <TN>;
185
- my $fn = <FN>;
186
- close FN;
187
- if ($tn eq $fn )
188
- {
189
- print " $final_name unchanged, not replacing\n " ;
190
- close TN;
191
- unlink ($temp_name ) || die " unlink: $temp_name : $! " ;
192
- return ;
193
- }
194
- }
195
- close TN;
196
- }
197
178
print " Writing $final_name \n " ;
198
179
rename ($temp_name , $final_name ) || die " rename: $temp_name : $! " ;
199
180
}
Original file line number Diff line number Diff line change 10
10
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
11
11
# Portions Copyright (c) 1994, Regents of the University of California
12
12
#
13
- # $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.1 2010/01/05 01:06:56 tgl Exp $
13
+ # $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.2 2010/01/05 02:34:03 tgl Exp $
14
14
#
15
15
# ----------------------------------------------------------------------
16
16
287
287
close SHDESCR;
288
288
close SCHEMAPG;
289
289
290
- # Rename temp files on top of final files, if they have changed
290
+ # Finally, rename the completed files into place.
291
291
Catalog::RenameTempFile($output_path . ' postgres.bki' );
292
292
Catalog::RenameTempFile($output_path . ' postgres.description' );
293
293
Catalog::RenameTempFile($output_path . ' postgres.shdescription' );
You can’t perform that action at this time.
0 commit comments