commit 755fdbd

default  ·  2024-08-12 14:09:47 +0000 UTC
parent 45278af
Variable renaming in xs_unix_socket, because it collides in Illumos.
2 files changed,  +9, -9
+8, -8
 1@@ -20,15 +20,15 @@ int xs_unix_socket_server(const char *path, const char *grp)
 2     int rs = -1;
 3 
 4     if ((rs = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
 5-        struct sockaddr_un sun = {0};
 6+        struct sockaddr_un su = {0};
 7         mode_t mode = 0666;
 8 
 9-        sun.sun_family = AF_UNIX;
10-        strncpy(sun.sun_path, path, sizeof(sun.sun_path));
11+        su.sun_family = AF_UNIX;
12+        strncpy(su.sun_path, path, sizeof(su.sun_path));
13 
14         unlink(path);
15 
16-        if (bind(rs, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
17+        if (bind(rs, (struct sockaddr *)&su, sizeof(su)) == -1) {
18             close(rs);
19             return -1;
20         }
21@@ -58,12 +58,12 @@ int xs_unix_socket_connect(const char *path)
22     int d = -1;
23 
24     if ((d = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
25-        struct sockaddr_un sun = {0};
26+        struct sockaddr_un su = {0};
27 
28-        sun.sun_family = AF_UNIX;
29-        strncpy(sun.sun_path, path, sizeof(sun.sun_path));
30+        su.sun_family = AF_UNIX;
31+        strncpy(su.sun_path, path, sizeof(su.sun_path));
32 
33-        if (connect(d, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
34+        if (connect(d, (struct sockaddr *)&su, sizeof(su)) == -1) {
35             close(d);
36             d = -1;
37         }
+1, -1
1@@ -1 +1 @@
2-/* 7c7c38b6d14c07cb85698223bcff4d3193245437 2024-08-11T21:48:09+02:00 */
3+/* c6eca9593f9b3d6791cba600e5950f682fdb36cf 2024-08-12T16:08:37+02:00 */