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 | |
parent | af8deff0fff573f750ffad4bef7ed8bb4988dba9 (diff) |
Improve error message on bbackupd command socket bind failure, thanks to Christophe.
Diffstat (limited to 'lib/server')
-rw-r--r-- | lib/server/ServerException.txt | 2 | ||||
-rw-r--r-- | lib/server/SocketListen.h | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/server/ServerException.txt b/lib/server/ServerException.txt index ed591b73..474b4067 100644 --- a/lib/server/ServerException.txt +++ b/lib/server/ServerException.txt @@ -13,7 +13,7 @@ SocketOpenError 10 SocketPollError 11 SocketCloseError 13 SocketNameUNIXPathTooLong 14 -SocketBindError 16 Check the ListenAddresses directive in your config file -- must refer to local IP addresses only +SocketBindError 16 Check the ListenAddresses directive (bbstored) or CommandSocket (bbackupd) in your config file -- must refer to local IP addresses (or existing writable path) only SocketAcceptError 17 ServerStreamBadListenAddrs 18 ServerForkError 19 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); } } |