@@ -343,8 +343,8 @@ static void LogChildExit(int lev, const char *procname,
343343int pid ,int exitstatus );
344344static void PostmasterStateMachine (void );
345345static void BackendInitialize (Port * port );
346- static int BackendRun (Port * port );
347- static void ExitPostmaster (int status );
346+ static void BackendRun (Port * port ) __attribute__(( noreturn ) );
347+ static void ExitPostmaster (int status ) __attribute__(( noreturn )) ;
348348static int ServerLoop (void );
349349static int BackendStartup (Port * port );
350350static int ProcessStartupPacket (Port * port ,bool SSLdone );
@@ -491,7 +491,7 @@ HANDLEPostmasterHandle;
491491/*
492492 * Postmaster main entry point
493493 */
494- int
494+ void
495495PostmasterMain (int argc ,char * argv [])
496496{
497497int opt ;
@@ -1125,7 +1125,7 @@ PostmasterMain(int argc, char *argv[])
11251125 */
11261126ExitPostmaster (status != STATUS_OK );
11271127
1128- return 0 ;/* not reached */
1128+ abort () ;/* not reached */
11291129}
11301130
11311131
@@ -3295,7 +3295,7 @@ BackendStartup(Port *port)
32953295BackendInitialize (port );
32963296
32973297/* And run the backend */
3298- proc_exit ( BackendRun (port ) );
3298+ BackendRun (port );
32993299}
33003300#endif /* EXEC_BACKEND */
33013301
@@ -3539,7 +3539,7 @@ BackendInitialize(Port *port)
35393539 *Shouldn't return at all.
35403540 *If PostgresMain() fails, return status.
35413541 */
3542- static int
3542+ static void
35433543BackendRun (Port * port )
35443544{
35453545char * * av ;
@@ -3610,7 +3610,7 @@ BackendRun(Port *port)
36103610 */
36113611MemoryContextSwitchTo (TopMemoryContext );
36123612
3613- return ( PostgresMain (ac ,av ,port -> user_name ) );
3613+ PostgresMain (ac ,av ,port -> user_name );
36143614}
36153615
36163616
@@ -3960,7 +3960,7 @@ internal_forkexec(int argc, char *argv[], Port *port)
39603960 * have been inherited by fork() on Unix. Remaining arguments go to the
39613961 * subprocess FooMain() routine.
39623962 */
3963- int
3963+ void
39643964SubPostmasterMain (int argc ,char * argv [])
39653965{
39663966Port port ;
@@ -4111,7 +4111,7 @@ SubPostmasterMain(int argc, char *argv[])
41114111CreateSharedMemoryAndSemaphores (false,0 );
41124112
41134113/* And run the backend */
4114- proc_exit ( BackendRun (& port ));
4114+ BackendRun (& port ); /* does not return */
41154115}
41164116if (strcmp (argv [1 ],"--forkboot" )== 0 )
41174117{
@@ -4127,8 +4127,7 @@ SubPostmasterMain(int argc, char *argv[])
41274127/* Attach process to shared data structures */
41284128CreateSharedMemoryAndSemaphores (false,0 );
41294129
4130- AuxiliaryProcessMain (argc - 2 ,argv + 2 );
4131- proc_exit (0 );
4130+ AuxiliaryProcessMain (argc - 2 ,argv + 2 );/* does not return */
41324131}
41334132if (strcmp (argv [1 ],"--forkavlauncher" )== 0 )
41344133{
@@ -4144,8 +4143,7 @@ SubPostmasterMain(int argc, char *argv[])
41444143/* Attach process to shared data structures */
41454144CreateSharedMemoryAndSemaphores (false,0 );
41464145
4147- AutoVacLauncherMain (argc - 2 ,argv + 2 );
4148- proc_exit (0 );
4146+ AutoVacLauncherMain (argc - 2 ,argv + 2 );/* does not return */
41494147}
41504148if (strcmp (argv [1 ],"--forkavworker" )== 0 )
41514149{
@@ -4161,8 +4159,7 @@ SubPostmasterMain(int argc, char *argv[])
41614159/* Attach process to shared data structures */
41624160CreateSharedMemoryAndSemaphores (false,0 );
41634161
4164- AutoVacWorkerMain (argc - 2 ,argv + 2 );
4165- proc_exit (0 );
4162+ AutoVacWorkerMain (argc - 2 ,argv + 2 );/* does not return */
41664163}
41674164if (strcmp (argv [1 ],"--forkarch" )== 0 )
41684165{
@@ -4171,8 +4168,7 @@ SubPostmasterMain(int argc, char *argv[])
41714168
41724169/* Do not want to attach to shared memory */
41734170
4174- PgArchiverMain (argc ,argv );
4175- proc_exit (0 );
4171+ PgArchiverMain (argc ,argv );/* does not return */
41764172}
41774173if (strcmp (argv [1 ],"--forkcol" )== 0 )
41784174{
@@ -4181,8 +4177,7 @@ SubPostmasterMain(int argc, char *argv[])
41814177
41824178/* Do not want to attach to shared memory */
41834179
4184- PgstatCollectorMain (argc ,argv );
4185- proc_exit (0 );
4180+ PgstatCollectorMain (argc ,argv );/* does not return */
41864181}
41874182if (strcmp (argv [1 ],"--forklog" )== 0 )
41884183{
@@ -4191,11 +4186,10 @@ SubPostmasterMain(int argc, char *argv[])
41914186
41924187/* Do not want to attach to shared memory */
41934188
4194- SysLoggerMain (argc ,argv );
4195- proc_exit (0 );
4189+ SysLoggerMain (argc ,argv );/* does not return */
41964190}
41974191
4198- return 1 ;/* shouldn't get here */
4192+ abort () ;/* shouldn't get here */
41994193}
42004194#endif /* EXEC_BACKEND */
42014195