Commit 3947f653 authored by Bruce Momjian's avatar Bruce Momjian

* postmaster.c: cleanup pmdaemonize under win32; missed failure message

in CreateOptsFile
* s_lock.c: minor comment fix
* findbe.c: variables not used under win32 moved within #ifndef WIN32
case

Claudio Natoli
parent 7b6fba9d
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.374 2004/03/15 15:56:21 momjian Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.375 2004/03/15 16:18:42 momjian Exp $
* *
* NOTES * NOTES
* *
...@@ -946,6 +946,10 @@ PostmasterMain(int argc, char *argv[]) ...@@ -946,6 +946,10 @@ PostmasterMain(int argc, char *argv[])
static void static void
pmdaemonize(int argc, char *argv[]) pmdaemonize(int argc, char *argv[])
{ {
#ifdef WIN32
/* not supported */
elog(FATAL,"SilentMode not supported under WIN32");
#else
int i; int i;
pid_t pid; pid_t pid;
...@@ -958,12 +962,7 @@ pmdaemonize(int argc, char *argv[]) ...@@ -958,12 +962,7 @@ pmdaemonize(int argc, char *argv[])
getitimer(ITIMER_PROF, &prof_itimer); getitimer(ITIMER_PROF, &prof_itimer);
#endif #endif
#ifdef WIN32
/* FIXME: [fork/exec] to be implemented? */
abort();
#else
pid = fork(); pid = fork();
#endif
if (pid == (pid_t) -1) if (pid == (pid_t) -1)
{ {
postmaster_error("could not fork background process: %s", postmaster_error("could not fork background process: %s",
...@@ -998,6 +997,7 @@ pmdaemonize(int argc, char *argv[]) ...@@ -998,6 +997,7 @@ pmdaemonize(int argc, char *argv[])
dup2(i, 1); dup2(i, 1);
dup2(i, 2); dup2(i, 2);
close(i); close(i);
#endif
} }
...@@ -3230,7 +3230,10 @@ CreateOptsFile(int argc, char *argv[]) ...@@ -3230,7 +3230,10 @@ CreateOptsFile(int argc, char *argv[])
int i; int i;
if (FindExec(fullprogname, argv[0], "postmaster") < 0) if (FindExec(fullprogname, argv[0], "postmaster") < 0)
{
elog(LOG, "could not locate postmaster");
return false; return false;
}
snprintf(filename, sizeof(filename), "%s/postmaster.opts", DataDir); snprintf(filename, sizeof(filename), "%s/postmaster.opts", DataDir);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.25 2004/02/10 03:42:45 tgl Exp $ * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.26 2004/03/15 16:18:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -72,7 +72,7 @@ s_lock(volatile slock_t *lock, const char *file, int line) ...@@ -72,7 +72,7 @@ s_lock(volatile slock_t *lock, const char *file, int line)
* (and thus the probability of unintended failure) than to fix the * (and thus the probability of unintended failure) than to fix the
* total time spent. * total time spent.
* *
* The select() delays are measured in centiseconds (0.01 sec) because 10 * The pg_usleep() delays are measured in centiseconds (0.01 sec) because 10
* msec is a common resolution limit at the OS level. * msec is a common resolution limit at the OS level.
*/ */
#define SPINS_PER_DELAY 100 #define SPINS_PER_DELAY 100
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/findbe.c,v 1.41 2004/02/02 00:11:31 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/init/findbe.c,v 1.42 2004/03/15 16:18:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -49,13 +49,13 @@ ValidateBinary(char *path) ...@@ -49,13 +49,13 @@ ValidateBinary(char *path)
uid_t euid; uid_t euid;
struct group *gp; struct group *gp;
struct passwd *pwp; struct passwd *pwp;
int i;
int in_grp = 0;
#else #else
char path_exe[MAXPGPATH + 2 + strlen(".exe")]; char path_exe[MAXPGPATH + 2 + strlen(".exe")];
#endif #endif
int i;
int is_r = 0; int is_r = 0;
int is_x = 0; int is_x = 0;
int in_grp = 0;
#ifdef WIN32 #ifdef WIN32
/* Win32 requires a .exe suffix for stat() */ /* Win32 requires a .exe suffix for stat() */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment