]> granicus.if.org Git - postgresql/commitdiff
Message style improvements of errmsg_internal() calls
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 5 Jul 2011 19:56:55 +0000 (22:56 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 5 Jul 2011 20:01:54 +0000 (23:01 +0300)
src/backend/libpq/auth.c
src/backend/libpq/be-secure.c
src/backend/port/pipe.c
src/backend/port/win32/signal.c
src/backend/port/win32/socket.c
src/backend/port/win32/timer.c
src/backend/postmaster/postmaster.c

index 778849e4347f13c7fd334b923682df15ad4e09dd..d8f440877b79ac04d703fcd29c363a530d957e87 100644 (file)
@@ -1436,7 +1436,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);
index 437a0c79b0af6919c40e2b666e38a3fe8b06d73a..f84ef5d506e1ae08a7733d55784a3f8029972d7a 100644 (file)
@@ -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);
        }
index b86a53ad34aa74d66fdc9921b8613eeb606835b7..b249e959107d8c2cc8a9aca5acc5f7b8de57ac15 100644 (file)
@@ -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);
index 92082a20b7a9b9adfa98cb74a6b8919ae5f38482..d2dfd01223c291ae891c28263015e33e61993082 100644 (file)
@@ -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")));
 }
 
 /*
index c918da981b283a6ee0b4d14b6a0c457ae78ea94e..b730f8eeda9016626a806de8757ffa1bc8e65b79 100644 (file)
@@ -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;
 }
index e118d96a4bcff85f7e840d04a42449c37f5d81e6..97224df386b80aa51119349ece81a5b24d447b85 100644 (file)
@@ -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())));
        }
 
index 1f0d4e63fb0ce0fdbb3ba0797aff65e28a420c4c..9a38b8a9bfee68e95cf4175131a9012271527cdf 100644 (file)
@@ -766,7 +766,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("-----------------------------------------")));