summaryrefslogtreecommitdiff
path: root/xs_socket.h
diff options
context:
space:
mode:
authorGravatar default2024-08-05 06:01:21 +0200
committerGravatar default2024-08-05 06:01:21 +0200
commit972c3dc5d43a114ae59386d4edfdfb8ce0f3793e (patch)
tree2568b6190dc0ca34478ccabc1191e504d1e8cfcf /xs_socket.h
parentMinor logging tweaks. (diff)
downloadsnac2-972c3dc5d43a114ae59386d4edfdfb8ce0f3793e.tar.gz
snac2-972c3dc5d43a114ae59386d4edfdfb8ce0f3793e.tar.xz
snac2-972c3dc5d43a114ae59386d4edfdfb8ce0f3793e.zip
Added support for listening on unix sockets.
Diffstat (limited to 'xs_socket.h')
-rw-r--r--xs_socket.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/xs_socket.h b/xs_socket.h
index 1c73a22..1bd053a 100644
--- a/xs_socket.h
+++ b/xs_socket.h
@@ -182,8 +182,10 @@ int xs_socket_connect(const char *addr, const char *serv)
182 host.sin_port = htons(atoi(serv)); 182 host.sin_port = htons(atoi(serv));
183 183
184 if ((d = socket(AF_INET, SOCK_STREAM, 0)) != -1) { 184 if ((d = socket(AF_INET, SOCK_STREAM, 0)) != -1) {
185 if (connect(d, (struct sockaddr *)&host, sizeof(host)) == -1) 185 if (connect(d, (struct sockaddr *)&host, sizeof(host)) == -1) {
186 close(d);
186 d = -1; 187 d = -1;
188 }
187 } 189 }
188 } 190 }
189 191