Consistently log strerror output as DETAIL

This commit is contained in:
Ian Barwick
2019-01-29 12:10:55 +09:00
parent e5f50e7b99
commit a48d408e4e
4 changed files with 14 additions and 11 deletions

View File

@@ -123,9 +123,9 @@ load_config(const char *config_file, bool verbose, bool terse, t_configuration_o
if (stat(config_file_path, &stat_config) != 0)
{
log_error(_("provided configuration file \"%s\" not found: %s"),
config_file,
strerror(errno));
log_error(_("provided configuration file \"%s\" not found"),
config_file);
log_detail("%s", strerror(errno));
exit(ERR_BAD_CONFIG);
}

View File

@@ -4376,9 +4376,8 @@ wait_connection_availability(PGconn *conn, long long timeout)
gettimeofday(&before, &tz);
if (select(sock, &read_set, NULL, NULL, &tmout) == -1)
{
log_warning(
_("wait_connection_availability(): select() returned with error:\n %s"),
strerror(errno));
log_warning(_("wait_connection_availability(): select() returned with error"));
log_detail("%s", strerror(errno));
return -1;
}

View File

@@ -351,8 +351,9 @@ create_pg_dir(const char *path, bool force)
}
break;
case DIR_ERROR:
log_error(_("could not access directory \"%s\": %s"),
path, strerror(errno));
log_error(_("could not access directory \"%s\"")
, path);
log_detail("%s", strerror(errno));
return false;
}

View File

@@ -618,7 +618,8 @@ daemonize_process(void)
switch (pid)
{
case -1:
log_error(_("error in fork():\n %s"), strerror(errno));
log_error(_("error in fork()"));
log_detail("%s", strerror(errno));
exit(ERR_SYS_FAILURE);
break;
@@ -627,7 +628,8 @@ daemonize_process(void)
pid = setsid();
if (pid == (pid_t) -1)
{
log_error(_("error in setsid():\n %s"), strerror(errno));
log_error(_("error executing setsid()"));
log_detail("%s", strerror(errno));
exit(ERR_SYS_FAILURE);
}
@@ -637,7 +639,8 @@ daemonize_process(void)
/* error case */
if (pid == -1)
{
log_error(_("error in fork():\n %s"), strerror(errno));
log_error(_("error executing fork()"));
log_detail("%s", strerror(errno));
exit(ERR_SYS_FAILURE);
}