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

Commitc424c04

Browse files
committed
pg_ctl: Write error messages to stderr
1 parent2dc4f01 commitc424c04

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,25 +256,24 @@ get_pgpid(bool is_status_request)
256256
if (stat(pg_data,&statbuf)!=0)
257257
{
258258
if (errno==ENOENT)
259-
printf(_("%s: directory \"%s\" does not exist\n"),progname,
260-
pg_data);
259+
write_stderr(_("%s: directory \"%s\" does not exist\n"),progname,
260+
pg_data);
261261
else
262-
printf(_("%s:cannotaccess directory \"%s\"\n"),progname,
263-
pg_data);
262+
write_stderr(_("%s:could notaccess directory \"%s\": %s\n"),progname,
263+
pg_data,strerror(errno));
264264

265265
/*
266266
* The Linux Standard Base Core Specification 3.1 says this should
267267
* return '4, program or service status is unknown'
268-
* https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-g
269-
* eneric/iniscrptact.html
268+
* https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
270269
*/
271270
exit(is_status_request ?4 :1);
272271
}
273272

274273
if (stat(version_file,&statbuf)!=0&&errno==ENOENT)
275274
{
276-
printf(_("%s: directory \"%s\" is not a database cluster directory\n"),
277-
progname,pg_data);
275+
write_stderr(_("%s: directory \"%s\" is not a database cluster directory\n"),
276+
progname,pg_data);
278277
exit(is_status_request ?4 :1);
279278
}
280279

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp