Merge 0.12->trunk
authorKim Alvefur <zash@zash.se>
Tue, 14 Jun 2022 19:21:20 +0200
changeset 12558 dbbbcf6b805e
parent 12556 b4bc5a715e65 (current diff)
parent 12557 cc0ec0277813 (diff)
child 12559 519e6403f455
Merge 0.12->trunk
--- a/prosody	Tue Jun 14 03:31:30 2022 +0200
+++ b/prosody	Tue Jun 14 19:21:20 2022 +0200
@@ -82,4 +82,4 @@
 
 loop();
 
-thread:run(startup.shutdown);
+startup.exit();
--- a/util/startup.lua	Tue Jun 14 03:31:30 2022 +0200
+++ b/util/startup.lua	Tue Jun 14 19:21:20 2022 +0200
@@ -353,7 +353,7 @@
 			reason = reason;
 			code = code;
 		});
-		server.setquitting(true);
+		prosody.main_thread:run(startup.shutdown);
 	end
 end
 
@@ -644,6 +644,10 @@
 
 	prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified");
 	prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0);
+	server.setquitting(true);
+end
+
+function startup.exit()
 	os.exit(prosody.shutdown_code);
 end