diff options
author | Matthew Wild <mwild1@gmail.com> | 2022-03-19 11:38:36 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2022-03-19 11:38:36 +0000 |
commit | f56d92085929518296b5342b9483ccb9bb1cd0cf (patch) | |
tree | 22f784ca0ed18508037a661716345b05b4e6f9e9 | |
parent | 921fc00eb76fcf64dc460ad04595b84cac49b66e (diff) | |
parent | f8690bf1513bc97708dd63e0355669e3f431cf4c (diff) | |
download | prosody-f56d92085929518296b5342b9483ccb9bb1cd0cf.tar.gz prosody-f56d92085929518296b5342b9483ccb9bb1cd0cf.zip |
Merge 0.12->trunk
-rw-r--r-- | plugins/mod_admin_socket.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index ffea9c61..c4e1d260 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -62,8 +62,16 @@ function module.load() 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 |