summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorPeter Eisentraut2021-04-23 12:18:11 +0000
committerPeter Eisentraut2021-04-23 12:21:37 +0000
commit82c3cd974131d7fa1cfcd07cebfb04fffe26ee35 (patch)
tree5e165fd8be0892ede2d4591ad32b559794fce887 /src/bin
parent9486844f301e265a3ad11b612decaba2462c3c15 (diff)
Factor out system call names from error messages
Instead, put them in via a format placeholder. This reduces the number of distinct translatable messages and also reduces the chances of typos during translation. We already did this for the system call arguments in a number of cases, so this is just the same thing taken a bit further. Discussion: https://www.postgresql.org/message-id/flat/92d6f545-5102-65d8-3c87-489f71ea0a37%40enterprisedb.com
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_basebackup/pg_recvlogical.c2
-rw-r--r--src/bin/pg_basebackup/receivelog.c2
-rw-r--r--src/bin/pg_dump/parallel.c6
-rw-r--r--src/bin/pg_upgrade/parallel.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index bf0246c4266..5efec160e88 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -411,7 +411,7 @@ StreamLogicalLog(void)
}
else if (r < 0)
{
- pg_log_error("select() failed: %m");
+ pg_log_error("%s() failed: %m", "select");
goto error;
}
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 7a2148fd05a..3952a3f9430 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -897,7 +897,7 @@ CopyStreamPoll(PGconn *conn, long timeout_ms, pgsocket stop_socket)
{
if (errno == EINTR)
return 0; /* Got a signal, so not an error */
- pg_log_error("select() failed: %m");
+ pg_log_error("%s() failed: %m", "select");
return -1;
}
if (ret > 0 && FD_ISSET(connsocket, &input_mask))
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c7351a43fde..f1577e785fa 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -251,7 +251,7 @@ init_parallel_dump_utils(void)
err = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (err != 0)
{
- pg_log_error("WSAStartup failed: %d", err);
+ pg_log_error("%s() failed: error code %d", "WSAStartup", err);
exit_nicely(1);
}
@@ -1611,7 +1611,7 @@ getMessageFromWorker(ParallelState *pstate, bool do_wait, int *worker)
}
if (i < 0)
- fatal("select() failed: %m");
+ fatal("%s() failed: %m", "select");
for (i = 0; i < pstate->numWorkers; i++)
{
@@ -1761,7 +1761,7 @@ pgpipe(int handles[2])
}
if (getsockname(s, (SOCKADDR *) &serv_addr, &len) == SOCKET_ERROR)
{
- pg_log_error("pgpipe: getsockname() failed: error code %d",
+ pg_log_error("pgpipe: %s() failed: error code %d", "getsockname",
WSAGetLastError());
closesocket(s);
return -1;
diff --git a/src/bin/pg_upgrade/parallel.c b/src/bin/pg_upgrade/parallel.c
index d5883e2eba4..ee7364da3bb 100644
--- a/src/bin/pg_upgrade/parallel.c
+++ b/src/bin/pg_upgrade/parallel.c
@@ -297,7 +297,7 @@ reap_child(bool wait_for_child)
#ifndef WIN32
child = waitpid(-1, &work_status, wait_for_child ? 0 : WNOHANG);
if (child == (pid_t) -1)
- pg_fatal("waitpid() failed: %s\n", strerror(errno));
+ pg_fatal("%s() failed: %s\n", "waitpid", strerror(errno));
if (child == 0)
return false; /* no children, or no dead children */
if (work_status != 0)