mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
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.
This commit is contained in:
@@ -120,7 +120,7 @@ static void WalSndLastCycleHandler(SIGNAL_ARGS);
|
||||
|
||||
/* Prototypes for private functions */
|
||||
static bool HandleReplicationCommand(const char *cmd_string);
|
||||
static int WalSndLoop(void);
|
||||
static void WalSndLoop(void) __attribute__((noreturn));
|
||||
static void InitWalSnd(void);
|
||||
static void WalSndHandshake(void);
|
||||
static void WalSndKill(int code, Datum arg);
|
||||
@@ -135,7 +135,7 @@ static void WalSndKeepalive(char *msgbuf);
|
||||
|
||||
|
||||
/* Main entry point for walsender process */
|
||||
int
|
||||
void
|
||||
WalSenderMain(void)
|
||||
{
|
||||
MemoryContext walsnd_context;
|
||||
@@ -192,7 +192,7 @@ WalSenderMain(void)
|
||||
SyncRepInitConfig();
|
||||
|
||||
/* Main loop of walsender */
|
||||
return WalSndLoop();
|
||||
WalSndLoop();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -706,7 +706,7 @@ ProcessStandbyHSFeedbackMessage(void)
|
||||
}
|
||||
|
||||
/* Main loop of walsender process */
|
||||
static int
|
||||
static void
|
||||
WalSndLoop(void)
|
||||
{
|
||||
char *output_message;
|
||||
@@ -882,7 +882,7 @@ WalSndLoop(void)
|
||||
whereToSendOutput = DestNone;
|
||||
|
||||
proc_exit(0);
|
||||
return 1; /* keep the compiler quiet */
|
||||
abort(); /* keep the compiler quiet */
|
||||
}
|
||||
|
||||
/* Initialize a per-walsender data structure for this walsender process */
|
||||
|
Reference in New Issue
Block a user