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

Commit2b53d58

Browse files
committed
Give a proper error message if initdb password file is empty.
Used to say just "could not read password from file "...": Success", whichisn't very informative.Mats Erik Andersson. Backpatch to all supported versions.
1 parente640042 commit2b53d58

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,12 @@ get_set_pwd(void)
13471347
}
13481348
if (!fgets(pwdbuf,sizeof(pwdbuf),pwf))
13491349
{
1350-
fprintf(stderr,_("%s: could not read password from file \"%s\": %s\n"),
1351-
progname,pwfilename,strerror(errno));
1350+
if (ferror(pwf))
1351+
fprintf(stderr,_("%s: could not read password from file \"%s\": %s\n"),
1352+
progname,pwfilename,strerror(errno));
1353+
else
1354+
fprintf(stderr,_("%s: password file \"%s\" is empty\n"),
1355+
progname,pwfilename);
13521356
exit_nicely();
13531357
}
13541358
fclose(pwf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp