diff --git a/contrib/pg_archivecleanup/pg_archivecleanup.c b/contrib/pg_archivecleanup/pg_archivecleanup.c index 039829e004..39348c6db1 100644 --- a/contrib/pg_archivecleanup/pg_archivecleanup.c +++ b/contrib/pg_archivecleanup/pg_archivecleanup.c @@ -165,12 +165,6 @@ CleanupPriorWALFiles(void) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) fprintf(stderr, "%s: could not read archive location \"%s\": %s\n", progname, archiveLocation, strerror(errno)); diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c index 9134d649cd..d6b169264c 100644 --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -284,12 +284,6 @@ CustomizableCleanupPriorWALFiles(void) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) fprintf(stderr, "%s: could not read archive location \"%s\": %s\n", progname, archiveLocation, strerror(errno)); diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 5158cfe806..42dbe87ca4 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -1956,12 +1956,6 @@ ReadDir(DIR *dir, const char *dirname) if ((dent = readdir(dir)) != NULL) return dent; -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) ereport(ERROR, (errcode_for_file_access(), diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index ce08494f49..b1dd1fe52f 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -564,12 +564,6 @@ walkdir(char *path, void (*action) (char *fname, bool isdir)) (*action) (subpath, false); } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { fprintf(stderr, _("%s: could not read directory \"%s\": %s\n"), diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c index 1eda4b6b00..406610a862 100644 --- a/src/bin/pg_basebackup/pg_receivexlog.c +++ b/src/bin/pg_basebackup/pg_receivexlog.c @@ -209,12 +209,6 @@ FindStreamingStart(uint32 *tli) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { fprintf(stderr, _("%s: could not read directory \"%s\": %s\n"), diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index b441ceaa46..0fae53b346 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -186,12 +186,6 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) exit_horribly(modulename, "could not read directory \"%s\": %s\n", ctx->directory, strerror(errno)); diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index af2cec7e93..b5d480e7b8 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -845,12 +845,6 @@ FindEndOfXLOG(void) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { fprintf(stderr, _("%s: could not read directory \"%s\": %s\n"), @@ -908,12 +902,6 @@ KillExistingXLOG(void) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { fprintf(stderr, _("%s: could not read directory \"%s\": %s\n"), @@ -966,12 +954,6 @@ KillExistingArchiveStatus(void) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { fprintf(stderr, _("%s: could not read directory \"%s\": %s\n"), diff --git a/src/common/pgfnames.c b/src/common/pgfnames.c index 51a848a1fd..016da32514 100644 --- a/src/common/pgfnames.c +++ b/src/common/pgfnames.c @@ -64,12 +64,6 @@ pgfnames(const char *path) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno) { #ifndef FRONTEND diff --git a/src/port/pgcheckdir.c b/src/port/pgcheckdir.c index 502d4f377d..07f250e9d4 100644 --- a/src/port/pgcheckdir.c +++ b/src/port/pgcheckdir.c @@ -64,12 +64,6 @@ pg_check_dir(const char *dir) } } -#ifdef WIN32 - /* Bug in old Mingw dirent.c; fixed in mingw-runtime-3.2, 2003-10-10 */ - if (GetLastError() == ERROR_NO_MORE_FILES) - errno = 0; -#endif - if (errno || closedir(chkdir)) result = -1; /* some kind of I/O error? */