mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +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:
@@ -173,7 +173,7 @@ main(int argc, char *argv[])
|
||||
|
||||
#ifdef EXEC_BACKEND
|
||||
if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0)
|
||||
exit(SubPostmasterMain(argc, argv));
|
||||
SubPostmasterMain(argc, argv); /* does not return */
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -189,14 +189,13 @@ main(int argc, char *argv[])
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "--boot") == 0)
|
||||
AuxiliaryProcessMain(argc, argv); /* does not return */
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
|
||||
exit(GucInfoMain());
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "--single") == 0)
|
||||
exit(PostgresMain(argc, argv, get_current_username(progname)));
|
||||
|
||||
exit(PostmasterMain(argc, argv));
|
||||
else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
|
||||
GucInfoMain(); /* does not return */
|
||||
else if (argc > 1 && strcmp(argv[1], "--single") == 0)
|
||||
PostgresMain(argc, argv, get_current_username(progname)); /* does not return */
|
||||
else
|
||||
PostmasterMain(argc, argv); /* does not return */
|
||||
abort(); /* should not get here */
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user