File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ services:
2626 - 5432
2727 node2 :
2828 image : citusdata/pg_auto_failover:demo
29- expose :
30- - 5432
3129 environment :
3230 PGDATA : /tmp/pgaf
3331 PG_AUTOCTL_DEBUG : 1
Original file line number Diff line number Diff line change @@ -1666,11 +1666,6 @@ pg_log_startup(const char *pgdata, int logLevel)
16661666 char pgLogFilePath [MAXPGPATH ] = { 0 };
16671667 struct stat pgLogFileStat ;
16681668
1669- /* our logFiles are regular files, skip . and .. and others */
1670- if (logFileDirEntry -> d_type != DT_REG )
1671- {
1672- continue ;
1673- }
16741669
16751670 /* build the absolute file path for the logfile */
16761671 join_path_components (pgLogFilePath ,
@@ -1684,6 +1679,28 @@ pg_log_startup(const char *pgdata, int logLevel)
16841679 pgLogFilePath );
16851680 return false;
16861681 }
1682+
1683+ /*
1684+ * our logFiles are regular files, skip . and .. and others
1685+ * first, check for systems that do not handle d_type, and skip non-regular types
1686+ */
1687+ if (logFileDirEntry -> d_type == DT_UNKNOWN )
1688+ {
1689+ if (!S_ISREG (pgLogFileStat .st_mode ))
1690+ {
1691+ continue ;
1692+ }
1693+ }
1694+
1695+ /*
1696+ * next, ignore all other non-regular types
1697+ * (if this check were first, we would skip all with DT_UNKNOWN)
1698+ */
1699+ else if (logFileDirEntry -> d_type != DT_REG )
1700+ {
1701+ continue ;
1702+ }
1703+
16871704 int64_t pgLogFileMtime = ST_MTIME_S (pgLogFileStat );
16881705
16891706 /*
You can’t perform that action at this time.
0 commit comments