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

Commit2712ca7

Browse files
committed
Fix initdb use of mkdir_p().
Andrew Dunstan
1 parent15b5d6c commit2712ca7

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* Portions Copyright (c) 1994, Regents of the University of California
4444
* Portions taken from FreeBSD.
4545
*
46-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.15 2003/11/29 19:52:04 pgsql Exp $
46+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.16 2003/12/01 23:15:47 momjian Exp $
4747
*
4848
*-------------------------------------------------------------------------
4949
*/
@@ -801,7 +801,6 @@ static bool
801801
mkdatadir(char*subdir)
802802
{
803803
char*path;
804-
intres;
805804

806805
path=xmalloc(strlen(pg_data)+2+
807806
(subdir==NULL ?0 :strlen(subdir)));
@@ -811,13 +810,7 @@ mkdatadir(char *subdir)
811810
else
812811
strcpy(path,pg_data);
813812

814-
res=mkdir(path,0700);
815-
if (res==0)
816-
return true;
817-
elseif (subdir==NULL||errno!=ENOENT)
818-
return false;
819-
else
820-
return !mkdir_p(path,0700);
813+
return (mkdir_p(path,0700)==0);
821814
}
822815

823816

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp