diff options
| author | Maxime Coste <mawww@kakoune.org> | 2016-12-17 05:46:04 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2016-12-17 05:46:04 +0000 |
| commit | dc84cdd5384523ccf6ff00bb227d174965ed9289 (patch) | |
| tree | 6cd4621351a484754604f2bfcde6006432700264 /src | |
| parent | 831d088ef49b5d9a90f9a53f70a3db8593c979fe (diff) | |
Add more diagnostic information when failing to bind/listen to socket
Diffstat (limited to 'src')
| -rw-r--r-- | src/remote.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/remote.cc b/src/remote.cc index c4d0cec0..4a2cfc3c 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -723,10 +723,12 @@ Server::Server(String session_name) auto restore_mask = on_scope_end([old_mask]() { umask(old_mask); }); if (bind(listen_sock, (sockaddr*) &addr, sizeof(sockaddr_un)) == -1) - throw runtime_error(format("unable to bind listen socket '{}'", addr.sun_path)); + throw runtime_error(format("unable to bind listen socket '{}': {}", + addr.sun_path, strerror(errno))); if (listen(listen_sock, 4) == -1) - throw runtime_error(format("unable to listen on socket '{}'", addr.sun_path)); + throw runtime_error(format("unable to listen on socket '{}': {}", + addr.sun_path, strerror(errno))); auto accepter = [this](FDWatcher& watcher, FdEvents, EventMode mode) { sockaddr_un client_addr; |
