Commit 927e5887 authored by Marc G. Fournier's avatar Marc G. Fournier

Added a #define NEED_SIG_JMP to config.h

Removed #ifdef's for OPENLINK_PATCH.  We enable it by default, and nobody
*has* to enable the functionality, but no reason to retain the "old code"
parent 6c3dff42
...@@ -7,18 +7,13 @@ ...@@ -7,18 +7,13 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.6 1996/08/17 06:41:10 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.7 1996/10/18 05:47:12 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "libpq/pqsignal.h" /* substitute for <signal.h> */ #include "libpq/pqsignal.h" /* substitute for <signal.h> */
#if defined(PORTNAME_linux)
#ifndef __USE_POSIX
#define __USE_POSIX
#endif
#endif /* defined(PORTNAME_linux) */
#include <setjmp.h> #include <setjmp.h>
#define BOOTSTRAP_INCLUDE /* mask out stuff in tcop/tcopprot.h */ #define BOOTSTRAP_INCLUDE /* mask out stuff in tcop/tcopprot.h */
...@@ -136,11 +131,9 @@ static char *relname; /* current relation name */ ...@@ -136,11 +131,9 @@ static char *relname; /* current relation name */
AttributeTupleForm attrtypes[MAXATTR]; /* points to attribute info */ AttributeTupleForm attrtypes[MAXATTR]; /* points to attribute info */
static char *values[MAXATTR]; /* cooresponding attribute values */ static char *values[MAXATTR]; /* cooresponding attribute values */
int numattr; /* number of attributes for cur. rel */ int numattr; /* number of attributes for cur. rel */
#ifdef OPENLINK_PATCHES
extern int fsyncOff; /* do not fsync the database */ extern int fsyncOff; /* do not fsync the database */
#endif
#if defined(WIN32) || defined(PORTNAME_next) #ifdef NEED_SIG_JMP
static jmp_buf Warn_restart; static jmp_buf Warn_restart;
#define sigsetjmp(x,y) setjmp(x) #define sigsetjmp(x,y) setjmp(x)
#define siglongjmp longjmp #define siglongjmp longjmp
...@@ -198,17 +191,11 @@ void err_out() ...@@ -198,17 +191,11 @@ void err_out()
*/ */
static void static void
usage() usage()
{ fprintf(stderr,"Usage: postgres -boot [-d] [-C] [-F] [-O] [-Q] ");
#ifdef OPENLINK_PATCHES fprintf(stderr,"[-P portno] [dbName]\n");
fprintf(stderr,"Usage: postgres -boot [-d] [-C] [-F] [-O] [-Q] [-P portno] [dbName]\n");
#else
fprintf(stderr,"Usage: postgres -boot [-d] [-C] [-O] [-Q] [-P portno] [dbName]\n");
#endif
fprintf(stderr," d: debug mode\n"); fprintf(stderr," d: debug mode\n");
fprintf(stderr," C: disable version checking\n"); fprintf(stderr," C: disable version checking\n");
#ifdef OPENLINK_PATCHES
fprintf(stderr," F: turn off fsync\n"); fprintf(stderr," F: turn off fsync\n");
#endif
fprintf(stderr," O: set BootstrapProcessing mode\n"); fprintf(stderr," O: set BootstrapProcessing mode\n");
fprintf(stderr," P portno: specify port number\n"); fprintf(stderr," P portno: specify port number\n");
...@@ -245,10 +232,10 @@ BootstrapMain(int argc, char *argv[]) ...@@ -245,10 +232,10 @@ BootstrapMain(int argc, char *argv[])
* ---------------- * ----------------
*/ */
signal(SIGINT, (sig_func) die); signal(SIGINT, (sig_func) die);
#ifndef WIN32 #ifndef win32
signal(SIGHUP, (sig_func) die); signal(SIGHUP, (sig_func) die);
signal(SIGTERM, (sig_func) die); signal(SIGTERM, (sig_func) die);
#endif /* WIN32 */ #endif /* win32 */
/* -------------------- /* --------------------
* initialize globals * initialize globals
...@@ -265,11 +252,7 @@ BootstrapMain(int argc, char *argv[]) ...@@ -265,11 +252,7 @@ BootstrapMain(int argc, char *argv[])
Noversion = 0; Noversion = 0;
dbName = NULL; dbName = NULL;
#ifdef OPENLINK_PATCHES
while ((flag = getopt(argc, argv, "dCOQP:F")) != EOF) { while ((flag = getopt(argc, argv, "dCOQP:F")) != EOF) {
#else
while ((flag = getopt(argc, argv, "dCOQP")) != EOF) {
#endif
switch (flag) { switch (flag) {
case 'd': case 'd':
DebugMode = 1; /* print out debuggin info while parsing */ DebugMode = 1; /* print out debuggin info while parsing */
...@@ -277,11 +260,9 @@ BootstrapMain(int argc, char *argv[]) ...@@ -277,11 +260,9 @@ BootstrapMain(int argc, char *argv[])
case 'C': case 'C':
Noversion = 1; Noversion = 1;
break; break;
#ifdef OPENLINK_PATCHES
case 'F': case 'F':
fsyncOff = 1; fsyncOff = 1;
break; break;
#endif
case 'O': case 'O':
override = true; override = true;
break; break;
...@@ -322,10 +303,10 @@ BootstrapMain(int argc, char *argv[]) ...@@ -322,10 +303,10 @@ BootstrapMain(int argc, char *argv[])
exitpg(1); exitpg(1);
} }
#ifdef WIN32 #ifdef win32
_nt_init(); _nt_init();
_nt_attach(); _nt_attach();
#endif /* WIN32 */ #endif /* win32 */
/* ---------------- /* ----------------
...@@ -349,13 +330,13 @@ BootstrapMain(int argc, char *argv[]) ...@@ -349,13 +330,13 @@ BootstrapMain(int argc, char *argv[])
* abort processing resumes here - What to do in WIN32? * abort processing resumes here - What to do in WIN32?
* ---------------- * ----------------
*/ */
#ifndef WIN32 #ifndef win32
signal(SIGHUP, handle_warn); signal(SIGHUP, handle_warn);
if (sigsetjmp(Warn_restart, 1) != 0) { if (sigsetjmp(Warn_restart, 1) != 0) {
#else #else
if (setjmp(Warn_restart) != 0) { if (setjmp(Warn_restart) != 0) {
#endif /* WIN32 */ #endif /* win32 */
Warnings++; Warnings++;
AbortCurrentTransaction(); AbortCurrentTransaction();
} }
......
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