Changeset

12419:6fe8ab3baa85

Merge 0.12->trunk
author Matthew Wild <mwild1@gmail.com>
date Sat, 19 Mar 2022 11:38:36 +0000
parents 12417:3635b0bfbd55 (current diff) 12418:dd47adf74e93 (diff)
children 12421:d9dee9c03d77
files
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_socket.lua	Sat Mar 19 11:09:28 2022 +0000
+++ b/plugins/mod_admin_socket.lua	Sat Mar 19 11:38:36 2022 +0000
@@ -62,8 +62,16 @@
 	sock = unix.stream();
 	sock:settimeout(0);
 	os.remove(socket_path);
-	assert(sock:bind(socket_path));
-	assert(sock:listen());
+	local ok, err = sock:bind(socket_path);
+	if not ok then
+		module:log_status("error", "Unable to bind admin socket %s: %s", socket_path, err);
+		return;
+	end
+	local ok, err = sock:listen();
+	if not ok then
+		module:log_status("error", "Unable to listen on admin socket %s: %s", socket_path, err);
+		return;
+	end
 	if server.wrapserver then
 		conn = server.wrapserver(sock, socket_path, 0, listeners);
 	else