diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-06-25 21:25:26 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-06-25 21:30:12 +0300 |
commit | eeece9e60984e76e5a41c1e2fa9efc5a1761e560 (patch) | |
tree | f1dfac89e34d678629b3f56ace2bb215b33f4a94 /src/backend/tcop/postgres.c | |
parent | c7d47abd04dc1322fd545370cfeb743680df0e3a (diff) | |
download | postgresql-eeece9e60984e76e5a41c1e2fa9efc5a1761e560.tar.gz postgresql-eeece9e60984e76e5a41c1e2fa9efc5a1761e560.zip |
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/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 51b6df54f4c..9a5438f18af 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3507,7 +3507,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx) * for the session. * ---------------------------------------------------------------- */ -int +void PostgresMain(int argc, char *argv[], const char *username) { const char *dbname; @@ -3721,7 +3721,10 @@ PostgresMain(int argc, char *argv[], const char *username) /* If this is a WAL sender process, we're done with initialization. */ if (am_walsender) - proc_exit(WalSenderMain()); + { + WalSenderMain(); /* does not return */ + abort(); + } /* * process any libraries that should be preloaded at backend start (this @@ -4199,7 +4202,7 @@ PostgresMain(int argc, char *argv[], const char *username) /* can't get here because the above loop never exits */ Assert(false); - return 1; /* keep compiler quiet */ + abort(); /* keep compiler quiet */ } |