From 7d0ceb82c71b9fc2c2884d2eeaba87fb546ef92b Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 16 Mar 2023 12:42:59 +0000 Subject: Improve an error message regarding Unix domain sockets. When starting unit, if its Unix domain control socket was already active you would get an error message like 2023/03/15 18:07:55 [alert] 53875#8669650 connect(5, unix:/tmp/control.sock) succeed, address already in use which is confusing in a couple of regards, firstly we have the classic success/failure message and secondly 'address already in use' is an actual errno value, EADDRINUSE and we didn't get an error from this connect(2). Re-word this error message for greater clarity. Reported-by: Liam Crilly Cc: Liam Crilly Signed-off-by: Andrew Clayton --- src/nxt_listen_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nxt_listen_socket.c b/src/nxt_listen_socket.c index f10abdef..d477eef1 100644 --- a/src/nxt_listen_socket.c +++ b/src/nxt_listen_socket.c @@ -161,7 +161,7 @@ nxt_listen_socket_create(nxt_task_t *task, nxt_mp_t *mp, nxt_socket_close(task, ts); if (ret == 0) { - nxt_alert(task, "connect(%d, %*s) succeed, address already in use", + nxt_alert(task, "connect(%d, %*s) socket already in use", ts, (size_t) orig_sa->length, nxt_sockaddr_start(orig_sa)); -- cgit