mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Message style improvements of errmsg_internal() calls
This commit is contained in:
@@ -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")));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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())));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user