summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-06-25 21:25:26 +0300
committerPeter Eisentraut <peter_e@gmx.net>2012-06-25 21:30:12 +0300
commiteeece9e60984e76e5a41c1e2fa9efc5a1761e560 (patch)
treef1dfac89e34d678629b3f56ace2bb215b33f4a94 /src/include
parentc7d47abd04dc1322fd545370cfeb743680df0e3a (diff)
downloadpostgresql-eeece9e60984e76e5a41c1e2fa9efc5a1761e560.tar.gz
Unify calling conventions for postgres/postmaster sub-main functions
There was a wild mix of calling conventions: Some were declared to return void and didn't return, some returned an int exit code, some claimed to return an exit code, which the callers checked, but actually never returned, and so on. Now all of these functions are declared to return void and decorated with attribute noreturn and don't return. That's easiest, and most code already worked that way.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootstrap/bootstrap.h2
-rw-r--r--src/include/pgstat.h2
-rw-r--r--src/include/postmaster/autovacuum.h4
-rw-r--r--src/include/postmaster/bgwriter.h4
-rw-r--r--src/include/postmaster/pgarch.h2
-rw-r--r--src/include/postmaster/postmaster.h4
-rw-r--r--src/include/postmaster/startup.h2
-rw-r--r--src/include/postmaster/syslogger.h2
-rw-r--r--src/include/postmaster/walwriter.h2
-rw-r--r--src/include/replication/walreceiver.h2
-rw-r--r--src/include/replication/walsender.h2
-rw-r--r--src/include/storage/ipc.h2
-rw-r--r--src/include/tcop/tcopprot.h4
-rw-r--r--src/include/utils/help_config.h2
14 files changed, 18 insertions, 18 deletions
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index e966a73977..b31bca9411 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -40,7 +40,7 @@ extern Form_pg_attribute attrtypes[MAXATTR];
extern int numattr;
-extern void AuxiliaryProcessMain(int argc, char *argv[]);
+extern void AuxiliaryProcessMain(int argc, char *argv[]) __attribute__((noreturn));
extern void err_out(void);
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index cad9b54e7b..613c1c2ad8 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -749,7 +749,7 @@ extern void pgstat_reset_all(void);
extern void allow_immediate_pgstat_restart(void);
#ifdef EXEC_BACKEND
-extern void PgstatCollectorMain(int argc, char *argv[]);
+extern void PgstatCollectorMain(int argc, char *argv[]) __attribute__((noreturn));
#endif
diff --git a/src/include/postmaster/autovacuum.h b/src/include/postmaster/autovacuum.h
index 8009fde1e0..a851758aeb 100644
--- a/src/include/postmaster/autovacuum.h
+++ b/src/include/postmaster/autovacuum.h
@@ -52,8 +52,8 @@ extern void AutoVacWorkerFailed(void);
extern void AutoVacuumUpdateDelay(void);
#ifdef EXEC_BACKEND
-extern void AutoVacLauncherMain(int argc, char *argv[]);
-extern void AutoVacWorkerMain(int argc, char *argv[]);
+extern void AutoVacLauncherMain(int argc, char *argv[]) __attribute__((noreturn));
+extern void AutoVacWorkerMain(int argc, char *argv[]) __attribute__((noreturn));
extern void AutovacuumWorkerIAm(void);
extern void AutovacuumLauncherIAm(void);
#endif
diff --git a/src/include/postmaster/bgwriter.h b/src/include/postmaster/bgwriter.h
index f46d4ad707..996065c2ed 100644
--- a/src/include/postmaster/bgwriter.h
+++ b/src/include/postmaster/bgwriter.h
@@ -25,8 +25,8 @@ extern int CheckPointTimeout;
extern int CheckPointWarning;
extern double CheckPointCompletionTarget;
-extern void BackgroundWriterMain(void);
-extern void CheckpointerMain(void);
+extern void BackgroundWriterMain(void) __attribute__((noreturn));
+extern void CheckpointerMain(void) __attribute__((noreturn));
extern void RequestCheckpoint(int flags);
extern void CheckpointWriteDelay(int flags, double progress);
diff --git a/src/include/postmaster/pgarch.h b/src/include/postmaster/pgarch.h
index 8e4472544f..be61031db1 100644
--- a/src/include/postmaster/pgarch.h
+++ b/src/include/postmaster/pgarch.h
@@ -20,7 +20,7 @@
extern int pgarch_start(void);
#ifdef EXEC_BACKEND
-extern void PgArchiverMain(int argc, char *argv[]);
+extern void PgArchiverMain(int argc, char *argv[]) __attribute__((noreturn));
#endif
#endif /* _PGARCH_H */
diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h
index 683ce3c407..7d01d3d624 100644
--- a/src/include/postmaster/postmaster.h
+++ b/src/include/postmaster/postmaster.h
@@ -46,14 +46,14 @@ extern int postmaster_alive_fds[2];
extern const char *progname;
-extern int PostmasterMain(int argc, char *argv[]);
+extern void PostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
extern void ClosePostmasterPorts(bool am_syslogger);
extern int MaxLivePostmasterChildren(void);
#ifdef EXEC_BACKEND
extern pid_t postmaster_forkexec(int argc, char *argv[]);
-extern int SubPostmasterMain(int argc, char *argv[]);
+extern void SubPostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
extern Size ShmemBackendArraySize(void);
extern void ShmemBackendArrayAllocation(void);
diff --git a/src/include/postmaster/startup.h b/src/include/postmaster/startup.h
index 3ec69502eb..54400b5d2a 100644
--- a/src/include/postmaster/startup.h
+++ b/src/include/postmaster/startup.h
@@ -13,7 +13,7 @@
#define _STARTUP_H
extern void HandleStartupProcInterrupts(void);
-extern void StartupProcessMain(void);
+extern void StartupProcessMain(void) __attribute__((noreturn));
extern void PreRestoreCommand(void);
extern void PostRestoreCommand(void);
extern bool IsPromoteTriggered(void);
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index dc88207b3d..cb0ccb6955 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -84,7 +84,7 @@ extern int SysLogger_Start(void);
extern void write_syslogger_file(const char *buffer, int count, int dest);
#ifdef EXEC_BACKEND
-extern void SysLoggerMain(int argc, char *argv[]);
+extern void SysLoggerMain(int argc, char *argv[]) __attribute__((noreturn));
#endif
#endif /* _SYSLOGGER_H */
diff --git a/src/include/postmaster/walwriter.h b/src/include/postmaster/walwriter.h
index 41c539a359..922142a9d1 100644
--- a/src/include/postmaster/walwriter.h
+++ b/src/include/postmaster/walwriter.h
@@ -15,6 +15,6 @@
/* GUC options */
extern int WalWriterDelay;
-extern void WalWriterMain(void);
+extern void WalWriterMain(void) __attribute__((noreturn));
#endif /* _WALWRITER_H */
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index d21ec94a45..31449d214e 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -109,7 +109,7 @@ typedef void (*walrcv_disconnect_type) (void);
extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect;
/* prototypes for functions in walreceiver.c */
-extern void WalReceiverMain(void);
+extern void WalReceiverMain(void) __attribute__((noreturn));
/* prototypes for functions in walreceiverfuncs.c */
extern Size WalRcvShmemSize(void);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index 128d2dbf59..65536016c2 100644
--- a/src/include/replication/walsender.h
+++ b/src/include/replication/walsender.h
@@ -26,7 +26,7 @@ extern volatile sig_atomic_t walsender_ready_to_stop;
extern int max_wal_senders;
extern int replication_timeout;
-extern int WalSenderMain(void);
+extern void WalSenderMain(void) __attribute__((noreturn));
extern void WalSndSignals(void);
extern Size WalSndShmemSize(void);
extern void WalSndShmemInit(void);
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h
index 16025c3dde..3bc2e58345 100644
--- a/src/include/storage/ipc.h
+++ b/src/include/storage/ipc.h
@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void);
/* ipc.c */
extern bool proc_exit_inprogress;
-extern void proc_exit(int code);
+extern void proc_exit(int code) __attribute__((noreturn));
extern void shmem_exit(int code);
extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index 964dd19c2c..2ac6554e64 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -61,7 +61,7 @@ extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
extern void assign_max_stack_depth(int newval, void *extra);
extern void die(SIGNAL_ARGS);
-extern void quickdie(SIGNAL_ARGS);
+extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
extern void StatementCancelHandler(SIGNAL_ARGS);
extern void FloatExceptionHandler(SIGNAL_ARGS);
extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
@@ -70,7 +70,7 @@ extern void prepare_for_client_read(void);
extern void client_read_ended(void);
extern const char *process_postgres_switches(int argc, char *argv[],
GucContext ctx);
-extern int PostgresMain(int argc, char *argv[], const char *username);
+extern void PostgresMain(int argc, char *argv[], const char *username) __attribute__((noreturn));
extern long get_stack_depth_rlimit(void);
extern void ResetUsage(void);
extern void ShowUsage(const char *title);
diff --git a/src/include/utils/help_config.h b/src/include/utils/help_config.h
index b569a4edad..61e04e9569 100644
--- a/src/include/utils/help_config.h
+++ b/src/include/utils/help_config.h
@@ -12,6 +12,6 @@
#ifndef HELP_CONFIG_H
#define HELP_CONFIG_H 1
-extern int GucInfoMain(void);
+extern void GucInfoMain(void) __attribute__((noreturn));
#endif