@@ -3321,7 +3321,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
33213321 }
33223322 pgstat_report_wait_end ();
33233323
3324- if (close (fd ))
3324+ if (close (fd ) != 0 )
33253325 ereport (ERROR ,
33263326 (errcode_for_file_access (),
33273327 errmsg ("could not close file \"%s\": %m" , tmppath )));
@@ -3489,12 +3489,12 @@ XLogFileCopy(XLogSegNo destsegno, TimeLineID srcTLI, XLogSegNo srcsegno,
34893489 errmsg ("could not fsync file \"%s\": %m" , tmppath )));
34903490 pgstat_report_wait_end ();
34913491
3492- if (CloseTransientFile (fd ))
3492+ if (CloseTransientFile (fd ) != 0 )
34933493 ereport (ERROR ,
34943494 (errcode_for_file_access (),
34953495 errmsg ("could not close file \"%s\": %m" , tmppath )));
34963496
3497- if (CloseTransientFile (srcfd ))
3497+ if (CloseTransientFile (srcfd ) != 0 )
34983498 ereport (ERROR ,
34993499 (errcode_for_file_access (),
35003500 errmsg ("could not close file \"%s\": %m" , path )));
@@ -3791,7 +3791,7 @@ XLogFileClose(void)
37913791 (void ) posix_fadvise (openLogFile , 0 , 0 , POSIX_FADV_DONTNEED );
37923792#endif
37933793
3794- if (close (openLogFile ))
3794+ if (close (openLogFile ) != 0 )
37953795 ereport (PANIC ,
37963796 (errcode_for_file_access (),
37973797 errmsg ("could not close file \"%s\": %m" ,
@@ -4566,7 +4566,7 @@ WriteControlFile(void)
45664566 XLOG_CONTROL_FILE )));
45674567 pgstat_report_wait_end ();
45684568
4569- if (close (fd ))
4569+ if (close (fd ) != 0 )
45704570 ereport (PANIC ,
45714571 (errcode_for_file_access (),
45724572 errmsg ("could not close file \"%s\": %m" ,
@@ -5225,7 +5225,7 @@ BootStrapXLOG(void)
52255225 errmsg ("could not fsync bootstrap write-ahead log file: %m" )));
52265226 pgstat_report_wait_end ();
52275227
5228- if (close (openLogFile ))
5228+ if (close (openLogFile ) != 0 )
52295229 ereport (PANIC ,
52305230 (errcode_for_file_access (),
52315231 errmsg ("could not close bootstrap write-ahead log file: %m" )));
@@ -5527,7 +5527,7 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
55275527
55285528 fd = XLogFileInit (startLogSegNo , & use_existent , true);
55295529
5530- if (close (fd ))
5530+ if (close (fd ) != 0 )
55315531 ereport (ERROR ,
55325532 (errcode_for_file_access (),
55335533 errmsg ("could not close file \"%s\": %m" ,
0 commit comments