aboutsummaryrefslogtreecommitdiffstats
path: root/common/network/UnixSocket.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-10-20 11:06:13 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:24:36 +0100
commit2b7857283b834391266e414adcff8c20f8fe3067 (patch)
tree146051a67b20b217593298eec695aafda89134f6 /common/network/UnixSocket.cxx
parented07250fef4e258d0d37d1c4e520db6d6c1e6fdb (diff)
downloadtigervnc-2b7857283b834391266e414adcff8c20f8fe3067.tar.gz
tigervnc-2b7857283b834391266e414adcff8c20f8fe3067.zip
Use standard library naming for exceptions
This makes things more consistent since we mix with the standard library exceptions so often.
Diffstat (limited to 'common/network/UnixSocket.cxx')
-rw-r--r--common/network/UnixSocket.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/network/UnixSocket.cxx b/common/network/UnixSocket.cxx
index 4b82b4b7..c8517300 100644
--- a/common/network/UnixSocket.cxx
+++ b/common/network/UnixSocket.cxx
@@ -53,12 +53,12 @@ UnixSocket::UnixSocket(const char *path)
socklen_t salen;
if (strlen(path) >= sizeof(addr.sun_path))
- throw SocketException("socket path is too long", ENAMETOOLONG);
+ throw socket_error("socket path is too long", ENAMETOOLONG);
// - Create a socket
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock == -1)
- throw SocketException("unable to create socket", errno);
+ throw socket_error("unable to create socket", errno);
// - Attempt to connect
memset(&addr, 0, sizeof(addr));
@@ -72,7 +72,7 @@ UnixSocket::UnixSocket(const char *path)
}
if (result == -1)
- throw SocketException("unable to connect to socket", err);
+ throw socket_error("unable to connect to socket", err);
setFd(sock);
}
@@ -119,11 +119,11 @@ UnixListener::UnixListener(const char *path, int mode)
int err, result;
if (strlen(path) >= sizeof(addr.sun_path))
- throw SocketException("socket path is too long", ENAMETOOLONG);
+ throw socket_error("socket path is too long", ENAMETOOLONG);
// - Create a socket
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
- throw SocketException("unable to create listening socket", errno);
+ throw socket_error("unable to create listening socket", errno);
// - Delete existing socket (ignore result)
unlink(path);
@@ -138,14 +138,14 @@ UnixListener::UnixListener(const char *path, int mode)
umask(saved_umask);
if (result < 0) {
close(fd);
- throw SocketException("unable to bind listening socket", err);
+ throw socket_error("unable to bind listening socket", err);
}
// - Set socket mode
if (chmod(path, mode) < 0) {
err = errno;
close(fd);
- throw SocketException("unable to set socket mode", err);
+ throw socket_error("unable to set socket mode", err);
}
listen(fd);