diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-10-31 21:09:45 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-10-31 21:09:45 +0000 |
commit | 767aa82685f80d4e1652f7f8eeaa0734ccf8f2f2 (patch) | |
tree | 17cdce7f75e6230b8ae00a3e3d1e45ea1b7b9984 /lib/server/SocketListen.h | |
parent | af8deff0fff573f750ffad4bef7ed8bb4988dba9 (diff) |
Improve error message on bbackupd command socket bind failure, thanks to Christophe.
Diffstat (limited to 'lib/server/SocketListen.h')
-rw-r--r-- | lib/server/SocketListen.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/server/SocketListen.h b/lib/server/SocketListen.h index 1ec6f512..170c56a1 100644 --- a/lib/server/SocketListen.h +++ b/lib/server/SocketListen.h @@ -166,10 +166,13 @@ public: if(::bind(mSocketHandle, &addr.sa_generic, addrLen) == -1 || ::listen(mSocketHandle, ListenBacklog) == -1) { + int err_number = errno; // Dispose of the socket ::close(mSocketHandle); mSocketHandle = -1; - THROW_EXCEPTION(ServerException, SocketBindError) + THROW_SYS_FILE_ERRNO("Failed to bind or listen " + "on socket", Name, err_number, + ServerException, SocketBindError); } } |