Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit74888b9

Browse files
committed
Add ERROR_NO_MORE_FILES workaround to check_data_dir(). This may or
may not be obsolete, but since every other readdir loop in our codehas it, I think this should too.
1 parent9216c89 commit74888b9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.93 2005/07/25 04:52:31 tgl Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.94 2005/08/02 15:16:27 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -930,7 +930,8 @@ check_data_dir(void)
930930

931931
while ((file=readdir(chkdir))!=NULL)
932932
{
933-
if (strcmp(".",file->d_name)==0||strcmp("..",file->d_name)==0)
933+
if (strcmp(".",file->d_name)==0||
934+
strcmp("..",file->d_name)==0)
934935
{
935936
/* skip this and parent directory */
936937
continue;
@@ -942,6 +943,15 @@ check_data_dir(void)
942943
}
943944
}
944945

946+
#ifdefWIN32
947+
/*
948+
* This fix is in mingw cvs (runtime/mingwex/dirent.c rev 1.4), but
949+
* not in released version
950+
*/
951+
if (GetLastError()==ERROR_NO_MORE_FILES)
952+
errno=0;
953+
#endif
954+
945955
closedir(chkdir);
946956

947957
if (errno!=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp