From: Peter Eisentraut Date: Tue, 5 Jul 2011 19:56:55 +0000 (+0300) Subject: Message style improvements of errmsg_internal() calls X-Git-Tag: REL9_2_BETA1~1447 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a0bdc8db5ceac574a2ae91cdf985499cd7c2b0c;p=postgresql Message style improvements of errmsg_internal() calls --- diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 0e847f5c48..7799111301 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -1432,7 +1432,7 @@ pg_SSPI_recvauth(Port *port) if (!LookupAccountSid(NULL, tokenuser->User.Sid, accountname, &accountnamesize, domainname, &domainnamesize, &accountnameuse)) ereport(ERROR, - (errmsg_internal("could not lookup acconut sid: error code %d", + (errmsg_internal("could not look up account SID: error code %d", (int) GetLastError()))); free(tokenuser); diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c index 437a0c79b0..f84ef5d506 100644 --- a/src/backend/libpq/be-secure.c +++ b/src/backend/libpq/be-secure.c @@ -644,7 +644,7 @@ tmp_dh_cb(SSL *s, int is_export, int keylength) if (r == NULL || 8 * DH_size(r) < keylength) { ereport(DEBUG2, - (errmsg_internal("DH: generating parameters (%d bits)....", + (errmsg_internal("DH: generating parameters (%d bits)", keylength))); r = DH_generate_parameters(keylength, DH_GENERATOR_2, NULL, NULL); } diff --git a/src/backend/port/pipe.c b/src/backend/port/pipe.c index b86a53ad34..b249e95910 100644 --- a/src/backend/port/pipe.c +++ b/src/backend/port/pipe.c @@ -29,7 +29,7 @@ pgpipe(int handles[2]) if ((s = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - ereport(LOG, (errmsg_internal("pgpipe failed to create socket: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not create socket: %ui", WSAGetLastError()))); return -1; } @@ -39,38 +39,38 @@ pgpipe(int handles[2]) serv_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if (bind(s, (SOCKADDR *) &serv_addr, len) == SOCKET_ERROR) { - ereport(LOG, (errmsg_internal("pgpipe failed to bind: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not bind: %ui", WSAGetLastError()))); closesocket(s); return -1; } if (listen(s, 1) == SOCKET_ERROR) { - ereport(LOG, (errmsg_internal("pgpipe failed to listen: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not listen: %ui", WSAGetLastError()))); closesocket(s); return -1; } if (getsockname(s, (SOCKADDR *) &serv_addr, &len) == SOCKET_ERROR) { - ereport(LOG, (errmsg_internal("pgpipe failed to getsockname: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not getsockname: %ui", WSAGetLastError()))); closesocket(s); return -1; } if ((handles[1] = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - ereport(LOG, (errmsg_internal("pgpipe failed to create socket 2: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not create socket 2: %ui", WSAGetLastError()))); closesocket(s); return -1; } if (connect(handles[1], (SOCKADDR *) &serv_addr, len) == SOCKET_ERROR) { - ereport(LOG, (errmsg_internal("pgpipe failed to connect socket: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not connect socket: %ui", WSAGetLastError()))); closesocket(s); return -1; } if ((handles[0] = accept(s, (SOCKADDR *) &serv_addr, &len)) == INVALID_SOCKET) { - ereport(LOG, (errmsg_internal("pgpipe failed to accept socket: %ui", WSAGetLastError()))); + ereport(LOG, (errmsg_internal("pgpipe could not accept socket: %ui", WSAGetLastError()))); closesocket(handles[1]); handles[1] = INVALID_SOCKET; closesocket(s); diff --git a/src/backend/port/win32/signal.c b/src/backend/port/win32/signal.c index 92082a20b7..d2dfd01223 100644 --- a/src/backend/port/win32/signal.c +++ b/src/backend/port/win32/signal.c @@ -83,18 +83,18 @@ pgwin32_signal_initialize(void) pgwin32_signal_event = CreateEvent(NULL, TRUE, FALSE, NULL); if (pgwin32_signal_event == NULL) ereport(FATAL, - (errmsg_internal("failed to create signal event: %d", (int) GetLastError()))); + (errmsg_internal("could not create signal event: %d", (int) GetLastError()))); /* Create thread for handling signals */ signal_thread_handle = CreateThread(NULL, 0, pg_signal_thread, NULL, 0, NULL); if (signal_thread_handle == NULL) ereport(FATAL, - (errmsg_internal("failed to create signal handler thread"))); + (errmsg_internal("could not create signal handler thread"))); /* Create console control handle to pick up Ctrl-C etc */ if (!SetConsoleCtrlHandler(pg_console_handler, TRUE)) ereport(FATAL, - (errmsg_internal("failed to set console control handler"))); + (errmsg_internal("could not set console control handler"))); } /* diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c index c918da981b..b730f8eeda 100644 --- a/src/backend/port/win32/socket.c +++ b/src/backend/port/win32/socket.c @@ -99,7 +99,7 @@ TranslateSocketError(void) break; default: ereport(NOTICE, - (errmsg_internal("Unknown win32 socket error code: %i", WSAGetLastError()))); + (errmsg_internal("unrecognized win32 socket error code: %i", WSAGetLastError()))); errno = EINVAL; } } @@ -143,11 +143,11 @@ pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout) if (waitevent == INVALID_HANDLE_VALUE) ereport(ERROR, - (errmsg_internal("Failed to create socket waiting event: %i", (int) GetLastError()))); + (errmsg_internal("could not create socket waiting event: %i", (int) GetLastError()))); } else if (!ResetEvent(waitevent)) ereport(ERROR, - (errmsg_internal("Failed to reset socket waiting event: %i", (int) GetLastError()))); + (errmsg_internal("could not reset socket waiting event: %i", (int) GetLastError()))); /* * make sure we don't multiplex this kernel event object with a different @@ -221,7 +221,7 @@ pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout) if (r == WAIT_TIMEOUT) return 0; ereport(ERROR, - (errmsg_internal("Bad return from WaitForMultipleObjects: %i (%i)", r, (int) GetLastError()))); + (errmsg_internal("unrecognized return value from WaitForMultipleObjects: %i (%i)", r, (int) GetLastError()))); return 0; } @@ -364,7 +364,7 @@ pgwin32_recv(SOCKET s, char *buf, int len, int f) return b; } ereport(NOTICE, - (errmsg_internal("Failed to read from ready socket (after retries)"))); + (errmsg_internal("could not read from ready socket (after retries)"))); errno = EWOULDBLOCK; return -1; } @@ -645,7 +645,7 @@ pgwin32_socket_strerror(int err) handleDLL = LoadLibraryEx("netmsg.dll", NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_AS_DATAFILE); if (handleDLL == NULL) ereport(FATAL, - (errmsg_internal("Failed to load netmsg.dll: %i", (int) GetLastError()))); + (errmsg_internal("could not load netmsg.dll: %i", (int) GetLastError()))); } ZeroMemory(&wserrbuf, sizeof(wserrbuf)); @@ -658,7 +658,7 @@ pgwin32_socket_strerror(int err) NULL) == 0) { /* Failed to get id */ - sprintf(wserrbuf, "Unknown winsock error %i", err); + sprintf(wserrbuf, "unrecognized winsock error %i", err); } return wserrbuf; } diff --git a/src/backend/port/win32/timer.c b/src/backend/port/win32/timer.c index e118d96a4b..97224df386 100644 --- a/src/backend/port/win32/timer.c +++ b/src/backend/port/win32/timer.c @@ -97,7 +97,7 @@ setitimer(int which, const struct itimerval * value, struct itimerval * ovalue) timerCommArea.event = CreateEvent(NULL, TRUE, FALSE, NULL); if (timerCommArea.event == NULL) ereport(FATAL, - (errmsg_internal("failed to create timer event: %d", + (errmsg_internal("could not create timer event: %d", (int) GetLastError()))); MemSet(&timerCommArea.value, 0, sizeof(struct itimerval)); @@ -107,7 +107,7 @@ setitimer(int which, const struct itimerval * value, struct itimerval * ovalue) timerThreadHandle = CreateThread(NULL, 0, pg_timer_thread, NULL, 0, NULL); if (timerThreadHandle == INVALID_HANDLE_VALUE) ereport(FATAL, - (errmsg_internal("failed to create timer thread: %d", + (errmsg_internal("could not create timer thread: %d", (int) GetLastError()))); } diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index b9bd50c671..bd0039e262 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -763,7 +763,7 @@ PostmasterMain(int argc, char *argv[]) char **p; ereport(DEBUG3, - (errmsg_internal("%s: PostmasterMain: initial environ dump:", + (errmsg_internal("%s: PostmasterMain: initial environment dump:", progname))); ereport(DEBUG3, (errmsg_internal("-----------------------------------------")));