Clarify some error messages

This commit is contained in:
Peter Eisentraut 2004-11-09 13:01:27 +00:00
parent 5c398e6e70
commit 3c093ff151
5 changed files with 19 additions and 19 deletions

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.5 2004/10/12 21:54:39 petere Exp $ * $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.6 2004/11/09 13:01:25 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -36,7 +36,7 @@ pgwin32_is_admin(void)
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &AccessToken)) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &AccessToken))
{ {
write_stderr("could not open process token: %d\n", write_stderr("could not open process token: error code %d\n",
(int) GetLastError()); (int) GetLastError());
exit(1); exit(1);
} }
@ -49,7 +49,7 @@ pgwin32_is_admin(void)
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{ {
write_stderr("could not get token information: %d\n", write_stderr("could not get token information: error code %d\n",
(int) GetLastError()); (int) GetLastError());
exit(1); exit(1);
} }
@ -66,7 +66,7 @@ pgwin32_is_admin(void)
if (!GetTokenInformation(AccessToken, TokenGroups, InfoBuffer, if (!GetTokenInformation(AccessToken, TokenGroups, InfoBuffer,
InfoBufferSize, &InfoBufferSize)) InfoBufferSize, &InfoBufferSize))
{ {
write_stderr("could not get token information: %d\n", write_stderr("could not get token information: error code %d\n",
(int) GetLastError()); (int) GetLastError());
exit(1); exit(1);
} }
@ -77,7 +77,7 @@ pgwin32_is_admin(void)
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0,
0, &AdministratorsSid)) 0, &AdministratorsSid))
{ {
write_stderr("could not get SID for Administrators group: %d\n", write_stderr("could not get SID for Administrators group: error code %d\n",
(int) GetLastError()); (int) GetLastError());
exit(1); exit(1);
} }
@ -86,7 +86,7 @@ pgwin32_is_admin(void)
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0,
0, &PowerUsersSid)) 0, &PowerUsersSid))
{ {
write_stderr("could not get SID for PowerUsers group: %d\n", write_stderr("could not get SID for PowerUsers group: error code %d\n",
(int) GetLastError()); (int) GetLastError());
exit(1); exit(1);
} }
@ -146,7 +146,7 @@ pgwin32_is_service(void)
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &AccessToken)) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &AccessToken))
{ {
fprintf(stderr, "could not open process token: %d\n", fprintf(stderr, "could not open process token: error code %d\n",
(int) GetLastError()); (int) GetLastError());
return -1; return -1;
} }
@ -154,7 +154,7 @@ pgwin32_is_service(void)
/* First check for local system */ /* First check for local system */
if (!GetTokenInformation(AccessToken, TokenUser, InfoBuffer, 1024, &InfoBufferSize)) if (!GetTokenInformation(AccessToken, TokenUser, InfoBuffer, 1024, &InfoBufferSize))
{ {
fprintf(stderr, "could not get token information: %d\n", fprintf(stderr, "could not get token information: error code %d\n",
(int) GetLastError()); (int) GetLastError());
return -1; return -1;
} }
@ -181,7 +181,7 @@ pgwin32_is_service(void)
/* Now check for group SID */ /* Now check for group SID */
if (!GetTokenInformation(AccessToken, TokenGroups, InfoBuffer, 1024, &InfoBufferSize)) if (!GetTokenInformation(AccessToken, TokenGroups, InfoBuffer, 1024, &InfoBufferSize))
{ {
fprintf(stderr, "could not get token information: %d\n", fprintf(stderr, "could not get token information: error code %d\n",
(int) GetLastError()); (int) GetLastError());
return -1; return -1;
} }

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.8 2004/10/12 21:54:39 petere Exp $ * $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.9 2004/11/09 13:01:25 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -224,7 +224,7 @@ pg_signal_thread(LPVOID param)
PIPE_UNLIMITED_INSTANCES, 16, 16, 1000, NULL); PIPE_UNLIMITED_INSTANCES, 16, 16, 1000, NULL);
if (pipe == INVALID_HANDLE_VALUE) if (pipe == INVALID_HANDLE_VALUE)
{ {
write_stderr("could not create signal listener pipe: %d; retrying\n", (int) GetLastError()); write_stderr("could not create signal listener pipe: error code %d; retrying\n", (int) GetLastError());
SleepEx(500, FALSE); SleepEx(500, FALSE);
continue; continue;
} }
@ -236,7 +236,7 @@ pg_signal_thread(LPVOID param)
(LPTHREAD_START_ROUTINE) pg_signal_dispatch_thread, (LPTHREAD_START_ROUTINE) pg_signal_dispatch_thread,
(LPVOID) pipe, 0, NULL); (LPVOID) pipe, 0, NULL);
if (hThread == INVALID_HANDLE_VALUE) if (hThread == INVALID_HANDLE_VALUE)
write_stderr("could not create signal dispatch thread: %d\n", write_stderr("could not create signal dispatch thread: error code %d\n",
(int) GetLastError()); (int) GetLastError());
else else
CloseHandle(hThread); CloseHandle(hThread);

View File

@ -19,7 +19,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.9 2004/08/29 05:06:46 momjian Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.10 2004/11/09 13:01:26 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -389,7 +389,7 @@ pgarch_ArchiverCopyLoop(void)
if (++failures >= NUM_ARCHIVE_RETRIES) if (++failures >= NUM_ARCHIVE_RETRIES)
{ {
ereport(WARNING, ereport(WARNING,
(errmsg("transaction log file \"%s\" could not be archived", (errmsg("transaction log file \"%s\" could not be archived: too many failures",
xlog))); xlog)));
return; /* give up archiving for now */ return; /* give up archiving for now */
} }

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.436 2004/11/02 03:34:50 momjian Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.437 2004/11/09 13:01:26 petere Exp $
* *
* NOTES * NOTES
* *
@ -2847,7 +2847,7 @@ internal_forkexec(int argc, char *argv[], Port *port)
if (execv(postgres_exec_path, argv) < 0) if (execv(postgres_exec_path, argv) < 0)
{ {
ereport(LOG, ereport(LOG,
(errmsg("could not exec backend process \"%s\": %m", (errmsg("could not execute server process \"%s\": %m",
postgres_exec_path))); postgres_exec_path)));
/* We're already in the child process here, can't return */ /* We're already in the child process here, can't return */
exit(1); exit(1);
@ -3760,7 +3760,7 @@ win32_sigchld_waiter(LPVOID param)
if (r == WAIT_OBJECT_0) if (r == WAIT_OBJECT_0)
pg_queue_signal(SIGCHLD); pg_queue_signal(SIGCHLD);
else else
write_stderr("could not wait on child process handle: %d\n", write_stderr("could not wait on child process handle: error code %d\n",
(int) GetLastError()); (int) GetLastError());
CloseHandle(procHandle); CloseHandle(procHandle);
return 0; return 0;

View File

@ -18,7 +18,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.10 2004/10/12 21:54:40 petere Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.11 2004/11/09 13:01:27 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -416,7 +416,7 @@ SysLogger_Start(void)
if (!CreatePipe(&syslogPipe[0], &syslogPipe[1], &sa, 32768)) if (!CreatePipe(&syslogPipe[0], &syslogPipe[1], &sa, 32768))
ereport(FATAL, ereport(FATAL,
(errcode_for_file_access(), (errcode_for_file_access(),
(errmsg("could not create pipe for syslogging: %m")))); (errmsg("could not create pipe for syslog: %m"))));
} }
#endif #endif