mirror of
https://github.com/postgres/postgres.git
synced 2025-11-25 12:03:53 +03:00
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4d wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -129,8 +129,8 @@ int Log_autovacuum_min_duration = -1;
|
||||
#define STATS_READ_DELAY 1000
|
||||
|
||||
/* the minimum allowed time between two awakenings of the launcher */
|
||||
#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */
|
||||
#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */
|
||||
#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */
|
||||
#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */
|
||||
|
||||
/* Flags to tell if we are in an autovacuum process */
|
||||
static bool am_autovacuum_launcher = false;
|
||||
@@ -516,7 +516,7 @@ AutoVacLauncherMain(int argc, char *argv[])
|
||||
|
||||
/* Forget any pending QueryCancel or timeout request */
|
||||
disable_all_timeouts(false);
|
||||
QueryCancelPending = false; /* second to avoid race condition */
|
||||
QueryCancelPending = false; /* second to avoid race condition */
|
||||
|
||||
/* Report the error to the server log */
|
||||
EmitErrorReport();
|
||||
|
||||
@@ -636,7 +636,7 @@ SanityCheckBackgroundWorker(BackgroundWorker *worker, int elevel)
|
||||
static void
|
||||
bgworker_quickdie(SIGNAL_ARGS)
|
||||
{
|
||||
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
|
||||
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
|
||||
PG_SETMASK(&BlockSig);
|
||||
|
||||
/*
|
||||
@@ -986,7 +986,7 @@ RegisterDynamicBackgroundWorker(BackgroundWorker *worker,
|
||||
if (!slot->in_use)
|
||||
{
|
||||
memcpy(&slot->worker, worker, sizeof(BackgroundWorker));
|
||||
slot->pid = InvalidPid; /* indicates not started yet */
|
||||
slot->pid = InvalidPid; /* indicates not started yet */
|
||||
slot->generation++;
|
||||
slot->terminate = false;
|
||||
generation = slot->generation;
|
||||
|
||||
@@ -122,8 +122,8 @@ BackgroundWriterMain(void)
|
||||
*/
|
||||
pqsignal(SIGHUP, BgSigHupHandler); /* set flag to read config file */
|
||||
pqsignal(SIGINT, SIG_IGN);
|
||||
pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */
|
||||
pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */
|
||||
pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */
|
||||
pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */
|
||||
pqsignal(SIGALRM, SIG_IGN);
|
||||
pqsignal(SIGPIPE, SIG_IGN);
|
||||
pqsignal(SIGUSR1, bgwriter_sigusr1_handler);
|
||||
|
||||
@@ -116,7 +116,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pid_t checkpointer_pid; /* PID (0 if not started) */
|
||||
pid_t checkpointer_pid; /* PID (0 if not started) */
|
||||
|
||||
slock_t ckpt_lck; /* protects all the ckpt_* fields */
|
||||
|
||||
@@ -126,8 +126,8 @@ typedef struct
|
||||
|
||||
int ckpt_flags; /* checkpoint flags, as defined in xlog.h */
|
||||
|
||||
uint32 num_backend_writes; /* counts user backend buffer writes */
|
||||
uint32 num_backend_fsync; /* counts user backend fsync calls */
|
||||
uint32 num_backend_writes; /* counts user backend buffer writes */
|
||||
uint32 num_backend_fsync; /* counts user backend fsync calls */
|
||||
|
||||
int num_requests; /* current # of requests */
|
||||
int max_requests; /* allocated array size */
|
||||
@@ -205,15 +205,14 @@ CheckpointerMain(void)
|
||||
* want to wait for the backends to exit, whereupon the postmaster will
|
||||
* tell us it's okay to shut down (via SIGUSR2).
|
||||
*/
|
||||
pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config
|
||||
* file */
|
||||
pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
|
||||
pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config file */
|
||||
pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
|
||||
pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */
|
||||
pqsignal(SIGQUIT, chkpt_quickdie); /* hard crash time */
|
||||
pqsignal(SIGALRM, SIG_IGN);
|
||||
pqsignal(SIGPIPE, SIG_IGN);
|
||||
pqsignal(SIGUSR1, chkpt_sigusr1_handler);
|
||||
pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */
|
||||
|
||||
/*
|
||||
* Reset some signals that are accepted by postmaster but not here
|
||||
|
||||
@@ -118,4 +118,4 @@ fork_process(void)
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* ! WIN32 */
|
||||
#endif /* ! WIN32 */
|
||||
|
||||
@@ -54,11 +54,10 @@
|
||||
* Timer definitions.
|
||||
* ----------
|
||||
*/
|
||||
#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
|
||||
* archive status directory; in
|
||||
* seconds. */
|
||||
#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
|
||||
* failed archiver; in seconds. */
|
||||
#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
|
||||
* archive status directory; in seconds. */
|
||||
#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
|
||||
* failed archiver; in seconds. */
|
||||
|
||||
#define NUM_ARCHIVE_RETRIES 3
|
||||
|
||||
@@ -203,7 +202,7 @@ pgarch_forkexec(void)
|
||||
|
||||
return postmaster_forkexec(ac, av);
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -74,21 +74,21 @@
|
||||
* Timer definitions.
|
||||
* ----------
|
||||
*/
|
||||
#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file
|
||||
* updates; in milliseconds. */
|
||||
#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file
|
||||
* updates; in milliseconds. */
|
||||
|
||||
#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for
|
||||
* a new file; in milliseconds. */
|
||||
#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for a
|
||||
* new file; in milliseconds. */
|
||||
|
||||
#define PGSTAT_MAX_WAIT_TIME 10000 /* Maximum time to wait for a stats
|
||||
* file update; in milliseconds. */
|
||||
|
||||
#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for
|
||||
* a new file; in milliseconds. */
|
||||
#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for a
|
||||
* new file; in milliseconds. */
|
||||
|
||||
#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a
|
||||
* failed statistics collector; in
|
||||
* seconds. */
|
||||
#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a
|
||||
* failed statistics collector; in
|
||||
* seconds. */
|
||||
|
||||
#define PGSTAT_POLL_LOOP_COUNT (PGSTAT_MAX_WAIT_TIME / PGSTAT_RETRY_DELAY)
|
||||
#define PGSTAT_INQ_LOOP_COUNT (PGSTAT_INQ_INTERVAL / PGSTAT_RETRY_DELAY)
|
||||
@@ -213,7 +213,7 @@ typedef struct PgStat_SubXactStatus
|
||||
{
|
||||
int nest_level; /* subtransaction nest level */
|
||||
struct PgStat_SubXactStatus *prev; /* higher-level subxact if any */
|
||||
PgStat_TableXactStatus *first; /* head of list for this subxact */
|
||||
PgStat_TableXactStatus *first; /* head of list for this subxact */
|
||||
} PgStat_SubXactStatus;
|
||||
|
||||
static PgStat_SubXactStatus *pgStatXactStack = NULL;
|
||||
@@ -226,9 +226,9 @@ PgStat_Counter pgStatBlockWriteTime = 0;
|
||||
/* Record that's written to 2PC state file when pgstat state is persisted */
|
||||
typedef struct TwoPhasePgStatRecord
|
||||
{
|
||||
PgStat_Counter tuples_inserted; /* tuples inserted in xact */
|
||||
PgStat_Counter tuples_updated; /* tuples updated in xact */
|
||||
PgStat_Counter tuples_deleted; /* tuples deleted in xact */
|
||||
PgStat_Counter tuples_inserted; /* tuples inserted in xact */
|
||||
PgStat_Counter tuples_updated; /* tuples updated in xact */
|
||||
PgStat_Counter tuples_deleted; /* tuples deleted in xact */
|
||||
PgStat_Counter inserted_pre_trunc; /* tuples inserted prior to truncate */
|
||||
PgStat_Counter updated_pre_trunc; /* tuples updated prior to truncate */
|
||||
PgStat_Counter deleted_pre_trunc; /* tuples deleted prior to truncate */
|
||||
@@ -710,7 +710,7 @@ pgstat_forkexec(void)
|
||||
|
||||
return postmaster_forkexec(ac, av);
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1290,7 +1290,7 @@ pgstat_drop_relation(Oid relid)
|
||||
msg.m_databaseid = MyDatabaseId;
|
||||
pgstat_send(&msg, len);
|
||||
}
|
||||
#endif /* NOT_USED */
|
||||
#endif /* NOT_USED */
|
||||
|
||||
|
||||
/* ----------
|
||||
|
||||
@@ -344,10 +344,10 @@ static time_t AbortStartTime = 0;
|
||||
/* Length of said timeout */
|
||||
#define SIGKILL_CHILDREN_AFTER_SECS 5
|
||||
|
||||
static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */
|
||||
static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */
|
||||
|
||||
bool ClientAuthInProgress = false; /* T during new-client
|
||||
* authentication */
|
||||
bool ClientAuthInProgress = false; /* T during new-client
|
||||
* authentication */
|
||||
|
||||
bool redirection_done = false; /* stderr redirected for syslogger? */
|
||||
|
||||
@@ -455,7 +455,7 @@ typedef struct
|
||||
HANDLE procHandle;
|
||||
DWORD procId;
|
||||
} win32_deadchild_waitinfo;
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
static pid_t backend_forkexec(Port *port);
|
||||
static pid_t internal_forkexec(int argc, char *argv[], Port *port);
|
||||
@@ -537,7 +537,7 @@ static bool save_backend_variables(BackendParameters *param, Port *port,
|
||||
|
||||
static void ShmemBackendArrayAdd(Backend *bn);
|
||||
static void ShmemBackendArrayRemove(Backend *bn);
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
#define StartupDataBase() StartChildProcess(StartupProcess)
|
||||
#define StartBackgroundWriter() StartChildProcess(BgWriterProcess)
|
||||
@@ -631,20 +631,18 @@ PostmasterMain(int argc, char *argv[])
|
||||
pqinitmask();
|
||||
PG_SETMASK(&BlockSig);
|
||||
|
||||
pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file
|
||||
* and have children do
|
||||
* same */
|
||||
pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file and
|
||||
* have children do same */
|
||||
pqsignal_no_restart(SIGINT, pmdie); /* send SIGTERM and shut down */
|
||||
pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */
|
||||
pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut
|
||||
* down */
|
||||
pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */
|
||||
pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut down */
|
||||
pqsignal(SIGALRM, SIG_IGN); /* ignored */
|
||||
pqsignal(SIGPIPE, SIG_IGN); /* ignored */
|
||||
pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child
|
||||
* process */
|
||||
pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for
|
||||
* children */
|
||||
pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */
|
||||
pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child
|
||||
* process */
|
||||
pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for
|
||||
* children */
|
||||
pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */
|
||||
pqsignal(SIGTTIN, SIG_IGN); /* ignored */
|
||||
pqsignal(SIGTTOU, SIG_IGN); /* ignored */
|
||||
/* ignore SIGXFSZ, so that ulimit violations work like disk full */
|
||||
@@ -3148,7 +3146,7 @@ CleanupBackgroundWorker(int pid,
|
||||
rw->rw_backend = NULL;
|
||||
rw->rw_pid = 0;
|
||||
rw->rw_child_slot = 0;
|
||||
ReportBackgroundWorkerExit(&iter); /* report child death */
|
||||
ReportBackgroundWorkerExit(&iter); /* report child death */
|
||||
|
||||
LogChildExit(EXIT_STATUS_0(exitstatus) ? DEBUG1 : LOG,
|
||||
namebuf, pid, exitstatus);
|
||||
@@ -4003,7 +4001,7 @@ BackendStartup(Port *port)
|
||||
/* And run the backend */
|
||||
BackendRun(port);
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
if (pid < 0)
|
||||
{
|
||||
@@ -4030,7 +4028,7 @@ BackendStartup(Port *port)
|
||||
* of backends.
|
||||
*/
|
||||
bn->pid = pid;
|
||||
bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */
|
||||
bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */
|
||||
dlist_push_head(&BackendList, &bn->elem);
|
||||
|
||||
#ifdef EXEC_BACKEND
|
||||
@@ -4120,7 +4118,7 @@ BackendInitialize(Port *port)
|
||||
* Must do this now because authentication uses libpq to send messages.
|
||||
*/
|
||||
pq_init(); /* initialize libpq to talk to client */
|
||||
whereToSendOutput = DestRemote; /* now safe to ereport to client */
|
||||
whereToSendOutput = DestRemote; /* now safe to ereport to client */
|
||||
|
||||
/*
|
||||
* We arrange for a simple exit(1) if we receive SIGTERM or SIGQUIT or
|
||||
@@ -4668,7 +4666,7 @@ internal_forkexec(int argc, char *argv[], Port *port)
|
||||
|
||||
return pi.dwProcessId;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -4842,7 +4840,7 @@ SubPostmasterMain(int argc, char *argv[])
|
||||
/* Attach process to shared data structures */
|
||||
CreateSharedMemoryAndSemaphores(false, 0);
|
||||
|
||||
AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
|
||||
AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
|
||||
}
|
||||
if (strcmp(argv[1], "--forkavlauncher") == 0)
|
||||
{
|
||||
@@ -4855,7 +4853,7 @@ SubPostmasterMain(int argc, char *argv[])
|
||||
/* Attach process to shared data structures */
|
||||
CreateSharedMemoryAndSemaphores(false, 0);
|
||||
|
||||
AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
|
||||
AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
|
||||
}
|
||||
if (strcmp(argv[1], "--forkavworker") == 0)
|
||||
{
|
||||
@@ -4896,24 +4894,24 @@ SubPostmasterMain(int argc, char *argv[])
|
||||
{
|
||||
/* Do not want to attach to shared memory */
|
||||
|
||||
PgArchiverMain(argc, argv); /* does not return */
|
||||
PgArchiverMain(argc, argv); /* does not return */
|
||||
}
|
||||
if (strcmp(argv[1], "--forkcol") == 0)
|
||||
{
|
||||
/* Do not want to attach to shared memory */
|
||||
|
||||
PgstatCollectorMain(argc, argv); /* does not return */
|
||||
PgstatCollectorMain(argc, argv); /* does not return */
|
||||
}
|
||||
if (strcmp(argv[1], "--forklog") == 0)
|
||||
{
|
||||
/* Do not want to attach to shared memory */
|
||||
|
||||
SysLoggerMain(argc, argv); /* does not return */
|
||||
SysLoggerMain(argc, argv); /* does not return */
|
||||
}
|
||||
|
||||
abort(); /* shouldn't get here */
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
|
||||
/*
|
||||
@@ -5272,7 +5270,7 @@ StartChildProcess(AuxProcType type)
|
||||
AuxiliaryProcessMain(ac, av);
|
||||
ExitPostmaster(0);
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
if (pid < 0)
|
||||
{
|
||||
@@ -6228,7 +6226,7 @@ ShmemBackendArrayRemove(Backend *bn)
|
||||
/* Mark the slot as empty */
|
||||
ShmemBackendArray[i].pid = 0;
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -6304,7 +6302,7 @@ pgwin32_deadchild_callback(PVOID lpParameter, BOOLEAN TimerOrWaitFired)
|
||||
/* Queue SIGCHLD signal */
|
||||
pg_queue_signal(SIGCHLD);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* Initialize one and only handle for monitoring postmaster death.
|
||||
@@ -6355,5 +6353,5 @@ InitPostmasterDeathWatchHandle(void)
|
||||
ereport(FATAL,
|
||||
(errmsg_internal("could not duplicate postmaster handle: error code %lu",
|
||||
GetLastError())));
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ StartupProcessMain(void)
|
||||
*/
|
||||
pqsignal(SIGHUP, StartupProcSigHupHandler); /* reload config file */
|
||||
pqsignal(SIGINT, SIG_IGN); /* ignore query cancel */
|
||||
pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGQUIT, startupproc_quickdie); /* hard crash time */
|
||||
InitializeTimeouts(); /* establishes SIGALRM handler */
|
||||
pqsignal(SIGPIPE, SIG_IGN);
|
||||
|
||||
@@ -169,7 +169,7 @@ SysLoggerMain(int argc, char *argv[])
|
||||
|
||||
#ifdef EXEC_BACKEND
|
||||
syslogger_parseArgs(argc, argv);
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
am_syslogger = true;
|
||||
|
||||
@@ -268,7 +268,7 @@ SysLoggerMain(int argc, char *argv[])
|
||||
threadHandle = (HANDLE) _beginthreadex(NULL, 0, pipeThread, NULL, 0, NULL);
|
||||
if (threadHandle == 0)
|
||||
elog(FATAL, "could not create syslogger data transfer thread: %m");
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* Remember active logfile's name. We recompute this from the reference
|
||||
@@ -490,7 +490,7 @@ SysLoggerMain(int argc, char *argv[])
|
||||
WAIT_EVENT_SYSLOGGER_MAIN);
|
||||
|
||||
EnterCriticalSection(&sysloggerSection);
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (pipe_eof_seen)
|
||||
{
|
||||
@@ -716,7 +716,7 @@ syslogger_forkexec(void)
|
||||
(long) _get_osfhandle(_fileno(syslogFile)));
|
||||
else
|
||||
strcpy(filenobuf, "0");
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
av[ac++] = filenobuf;
|
||||
|
||||
av[ac] = NULL;
|
||||
@@ -756,9 +756,9 @@ syslogger_parseArgs(int argc, char *argv[])
|
||||
setvbuf(syslogFile, NULL, PG_IOLBF, 0);
|
||||
}
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
#endif /* EXEC_BACKEND */
|
||||
#endif /* EXEC_BACKEND */
|
||||
|
||||
|
||||
/* --------------------------------
|
||||
@@ -1084,7 +1084,7 @@ pipeThread(void *arg)
|
||||
_endthread();
|
||||
return 0;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* Open the csv log file - we do this opportunistically, because
|
||||
@@ -1103,7 +1103,7 @@ open_csvlogfile(void)
|
||||
|
||||
csvlogFile = logfile_open(filename, "a", false);
|
||||
|
||||
if (last_csv_file_name != NULL) /* probably shouldn't happen */
|
||||
if (last_csv_file_name != NULL) /* probably shouldn't happen */
|
||||
pfree(last_csv_file_name);
|
||||
|
||||
last_csv_file_name = filename;
|
||||
|
||||
@@ -109,8 +109,8 @@ WalWriterMain(void)
|
||||
* reasonable to treat like SIGTERM.
|
||||
*/
|
||||
pqsignal(SIGHUP, WalSigHupHandler); /* set flag to read config file */
|
||||
pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */
|
||||
pqsignal(SIGQUIT, wal_quickdie); /* hard crash time */
|
||||
pqsignal(SIGALRM, SIG_IGN);
|
||||
pqsignal(SIGPIPE, SIG_IGN);
|
||||
@@ -286,7 +286,7 @@ WalWriterMain(void)
|
||||
* sleep time so as to reduce the server's idle power consumption.
|
||||
*/
|
||||
if (left_till_hibernate > 0)
|
||||
cur_timeout = WalWriterDelay; /* in ms */
|
||||
cur_timeout = WalWriterDelay; /* in ms */
|
||||
else
|
||||
cur_timeout = WalWriterDelay * HIBERNATE_FACTOR;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user