Skip to content

Commit 3947f65

Browse files
committed
* 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
1 parent 7b6fba9 commit 3947f65

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.374 2004/03/15 15:56:21 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.375 2004/03/15 16:18:42 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -946,6 +946,10 @@ PostmasterMain(int argc, char *argv[])
946946
static void
947947
pmdaemonize(int argc, char *argv[])
948948
{
949+
#ifdef WIN32
950+
/* not supported */
951+
elog(FATAL,"SilentMode not supported under WIN32");
952+
#else
949953
int i;
950954
pid_t pid;
951955

@@ -958,12 +962,7 @@ pmdaemonize(int argc, char *argv[])
958962
getitimer(ITIMER_PROF, &prof_itimer);
959963
#endif
960964

961-
#ifdef WIN32
962-
/* FIXME: [fork/exec] to be implemented? */
963-
abort();
964-
#else
965965
pid = fork();
966-
#endif
967966
if (pid == (pid_t) -1)
968967
{
969968
postmaster_error("could not fork background process: %s",
@@ -998,6 +997,7 @@ pmdaemonize(int argc, char *argv[])
998997
dup2(i, 1);
999998
dup2(i, 2);
1000999
close(i);
1000+
#endif
10011001
}
10021002

10031003

@@ -3230,7 +3230,10 @@ CreateOptsFile(int argc, char *argv[])
32303230
int i;
32313231

32323232
if (FindExec(fullprogname, argv[0], "postmaster") < 0)
3233+
{
3234+
elog(LOG, "could not locate postmaster");
32333235
return false;
3236+
}
32343237

32353238
snprintf(filename, sizeof(filename), "%s/postmaster.opts", DataDir);
32363239

src/backend/storage/lmgr/s_lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.25 2004/02/10 03:42:45 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.26 2004/03/15 16:18:43 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -72,7 +72,7 @@ s_lock(volatile slock_t *lock, const char *file, int line)
7272
* (and thus the probability of unintended failure) than to fix the
7373
* total time spent.
7474
*
75-
* The select() delays are measured in centiseconds (0.01 sec) because 10
75+
* The pg_usleep() delays are measured in centiseconds (0.01 sec) because 10
7676
* msec is a common resolution limit at the OS level.
7777
*/
7878
#define SPINS_PER_DELAY 100

src/backend/utils/init/findbe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/init/findbe.c,v 1.41 2004/02/02 00:11:31 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/init/findbe.c,v 1.42 2004/03/15 16:18:43 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -49,13 +49,13 @@ ValidateBinary(char *path)
4949
uid_t euid;
5050
struct group *gp;
5151
struct passwd *pwp;
52+
int i;
53+
int in_grp = 0;
5254
#else
5355
char path_exe[MAXPGPATH + 2 + strlen(".exe")];
5456
#endif
55-
int i;
5657
int is_r = 0;
5758
int is_x = 0;
58-
int in_grp = 0;
5959

6060
#ifdef WIN32
6161
/* Win32 requires a .exe suffix for stat() */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy