diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-04-19 17:42:59 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-04-19 17:42:59 +0000 |
commit | 31338352bd89439c7c55d25c13d88338fa874771 (patch) | |
tree | 318c34ab817a8d3e47b2fa6fa1c37ceacd8541a4 /src/backend/postmaster/postmaster.c | |
parent | 862b20b3822887bdb3b42a72ea0e73dc8028fb31 (diff) | |
download | postgresql-31338352bd89439c7c55d25c13d88338fa874771.tar.gz postgresql-31338352bd89439c7c55d25c13d88338fa874771.zip |
* Most changes are to fix warnings issued when compiling win32
* removed a few redundant defines
* get_user_name safe under win32
* rationalized pipe read EOF for win32 (UPDATED PATCH USED)
* changed all backend instances of sleep() to pg_usleep
- except for the SLEEP_ON_ASSERT in assert.c, as it would exceed a
32-bit long [Note to patcher: If a SLEEP_ON_ASSERT of 2000 seconds is
acceptable, please replace with pg_usleep(2000000000L)]
I added a comment to that part of the code:
/*
* It would be nice to use pg_usleep() here, but only does 2000 sec
* or 33 minutes, which seems too short.
*/
sleep(1000000);
Claudio Natoli
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 6876044a6a9..3cbd40f3db6 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.380 2004/04/12 16:19:18 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.381 2004/04/19 17:42:58 momjian Exp $ * * NOTES * @@ -314,8 +314,6 @@ static unsigned long tmpBackendFileNum = 0; void read_backend_variables(unsigned long id, Port *port); static bool write_backend_variables(Port *port); -size_t ShmemBackendArraySize(void); -void ShmemBackendArrayAllocation(void); static void ShmemBackendArrayAdd(Backend *bn); static void ShmemBackendArrayRemove(pid_t pid); #endif @@ -2561,7 +2559,7 @@ BackendRun(Port *port) * PGOPTIONS, but it is not honored until after authentication.) */ if (PreAuthDelay > 0) - sleep(PreAuthDelay); + pg_usleep(PreAuthDelay*1000000L); /* Will exit on failure */ BackendInit(port); @@ -3455,8 +3453,8 @@ static void ShmemBackendArrayAdd(Backend *bn) } } - /* FIXME: [fork/exec] some sort of error */ - abort(); + ereport(FATAL, + (errmsg_internal("unable to add backend entry"))); } static void ShmemBackendArrayRemove(pid_t pid) @@ -3472,7 +3470,6 @@ static void ShmemBackendArrayRemove(pid_t pid) } } - /* Something stronger than WARNING here? */ ereport(WARNING, (errmsg_internal("unable to find backend entry with pid %d", pid))); @@ -3565,8 +3562,9 @@ static void win32_AddChild(pid_t pid, HANDLE handle) ++win32_numChildren; } else - /* FIXME: [fork/exec] some sort of error */ - abort(); + ereport(FATAL, + (errmsg_internal("unable to add child entry with pid %lu", + pid))); } static void win32_RemoveChild(pid_t pid) @@ -3588,7 +3586,6 @@ static void win32_RemoveChild(pid_t pid) } } - /* Something stronger than WARNING here? */ ereport(WARNING, (errmsg_internal("unable to find child entry with pid %lu", pid))); |