summaryrefslogtreecommitdiff
path: root/src/backend/main
diff options
context:
space:
mode:
authorAndres Freund2021-08-05 19:36:06 +0000
committerAndres Freund2021-08-05 19:36:06 +0000
commit07bf37850991c68a7038fb06186bddfd64c72faf (patch)
treec929af8139ca608e480249f3e767004d401f54db /src/backend/main
parentf8dd4ecb0b7fc3420e199021375e622815cd326f (diff)
process startup: Centralize pgwin32_signal_initialize() calls.
For one, the existing location lead to somewhat awkward code in main(). For another, the new location is easier to understand anyway. Author: Andres Freund <andres@anarazel.de> Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-By: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/20210802164124.ufo5buo4apl6yuvs@alap3.anarazel.de
Diffstat (limited to 'src/backend/main')
-rw-r--r--src/backend/main/main.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index 9be39739567..3a2a0d598cd 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -181,35 +181,24 @@ main(int argc, char *argv[])
* Dispatch to one of various subprograms depending on first argument.
*/
-#ifdef EXEC_BACKEND
- if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0)
- SubPostmasterMain(argc, argv); /* does not return */
-#endif
-
-#ifdef WIN32
-
- /*
- * Start our win32 signal implementation
- *
- * SubPostmasterMain() will do this for itself, but the remaining modes
- * need it here
- */
- pgwin32_signal_initialize();
-#endif
-
if (argc > 1 && strcmp(argv[1], "--check") == 0)
BootstrapModeMain(argc, argv, true);
else if (argc > 1 && strcmp(argv[1], "--boot") == 0)
BootstrapModeMain(argc, argv, false);
+#ifdef EXEC_BACKEND
+ else if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0)
+ SubPostmasterMain(argc, argv);
+#endif
else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
- GucInfoMain(); /* does not return */
+ GucInfoMain();
else if (argc > 1 && strcmp(argv[1], "--single") == 0)
PostgresMain(argc, argv,
NULL, /* no dbname */
- strdup(get_user_name_or_exit(progname))); /* does not return */
+ strdup(get_user_name_or_exit(progname)));
else
- PostmasterMain(argc, argv); /* does not return */
- abort(); /* should not get here */
+ PostmasterMain(argc, argv);
+ /* the functions above should not return */
+ abort();
}