diff options
| author | Peter Eisentraut | 2012-06-25 18:25:26 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2012-06-25 18:30:12 +0000 |
| commit | eeece9e60984e76e5a41c1e2fa9efc5a1761e560 (patch) | |
| tree | f1dfac89e34d678629b3f56ace2bb215b33f4a94 /src/include/postmaster | |
| parent | c7d47abd04dc1322fd545370cfeb743680df0e3a (diff) | |
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/postmaster')
| -rw-r--r-- | src/include/postmaster/autovacuum.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/bgwriter.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/pgarch.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/postmaster.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/startup.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/syslogger.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/walwriter.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/src/include/postmaster/autovacuum.h b/src/include/postmaster/autovacuum.h index 8009fde1e07..a851758aeb6 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 f46d4ad7077..996065c2edf 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 8e4472544f1..be61031db17 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 683ce3c4074..7d01d3d6248 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 3ec69502eb1..54400b5d2ac 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 dc88207b3d9..cb0ccb6955b 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 41c539a359d..922142a9d11 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 */ |
