@@ -3321,7 +3321,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
3321
3321
}
3322
3322
pgstat_report_wait_end ();
3323
3323
3324
- if (close (fd ))
3324
+ if (close (fd ) != 0 )
3325
3325
ereport (ERROR ,
3326
3326
(errcode_for_file_access (),
3327
3327
errmsg ("could not close file \"%s\": %m" , tmppath )));
@@ -3489,12 +3489,12 @@ XLogFileCopy(XLogSegNo destsegno, TimeLineID srcTLI, XLogSegNo srcsegno,
3489
3489
errmsg ("could not fsync file \"%s\": %m" , tmppath )));
3490
3490
pgstat_report_wait_end ();
3491
3491
3492
- if (CloseTransientFile (fd ))
3492
+ if (CloseTransientFile (fd ) != 0 )
3493
3493
ereport (ERROR ,
3494
3494
(errcode_for_file_access (),
3495
3495
errmsg ("could not close file \"%s\": %m" , tmppath )));
3496
3496
3497
- if (CloseTransientFile (srcfd ))
3497
+ if (CloseTransientFile (srcfd ) != 0 )
3498
3498
ereport (ERROR ,
3499
3499
(errcode_for_file_access (),
3500
3500
errmsg ("could not close file \"%s\": %m" , path )));
@@ -3791,7 +3791,7 @@ XLogFileClose(void)
3791
3791
(void ) posix_fadvise (openLogFile , 0 , 0 , POSIX_FADV_DONTNEED );
3792
3792
#endif
3793
3793
3794
- if (close (openLogFile ))
3794
+ if (close (openLogFile ) != 0 )
3795
3795
ereport (PANIC ,
3796
3796
(errcode_for_file_access (),
3797
3797
errmsg ("could not close file \"%s\": %m" ,
@@ -4566,7 +4566,7 @@ WriteControlFile(void)
4566
4566
XLOG_CONTROL_FILE )));
4567
4567
pgstat_report_wait_end ();
4568
4568
4569
- if (close (fd ))
4569
+ if (close (fd ) != 0 )
4570
4570
ereport (PANIC ,
4571
4571
(errcode_for_file_access (),
4572
4572
errmsg ("could not close file \"%s\": %m" ,
@@ -5225,7 +5225,7 @@ BootStrapXLOG(void)
5225
5225
errmsg ("could not fsync bootstrap write-ahead log file: %m" )));
5226
5226
pgstat_report_wait_end ();
5227
5227
5228
- if (close (openLogFile ))
5228
+ if (close (openLogFile ) != 0 )
5229
5229
ereport (PANIC ,
5230
5230
(errcode_for_file_access (),
5231
5231
errmsg ("could not close bootstrap write-ahead log file: %m" )));
@@ -5527,7 +5527,7 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
5527
5527
5528
5528
fd = XLogFileInit (startLogSegNo , & use_existent , true);
5529
5529
5530
- if (close (fd ))
5530
+ if (close (fd ) != 0 )
5531
5531
ereport (ERROR ,
5532
5532
(errcode_for_file_access (),
5533
5533
errmsg ("could not close file \"%s\": %m" ,
0 commit comments