diff options
| -rw-r--r-- | xs_unix_socket.h | 16 | ||||
| -rw-r--r-- | xs_version.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/xs_unix_socket.h b/xs_unix_socket.h index 5b64282..3eb2307 100644 --- a/xs_unix_socket.h +++ b/xs_unix_socket.h | |||
| @@ -20,15 +20,15 @@ int xs_unix_socket_server(const char *path, const char *grp) | |||
| 20 | int rs = -1; | 20 | int rs = -1; |
| 21 | 21 | ||
| 22 | if ((rs = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { | 22 | if ((rs = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { |
| 23 | struct sockaddr_un sun = {0}; | 23 | struct sockaddr_un su = {0}; |
| 24 | mode_t mode = 0666; | 24 | mode_t mode = 0666; |
| 25 | 25 | ||
| 26 | sun.sun_family = AF_UNIX; | 26 | su.sun_family = AF_UNIX; |
| 27 | strncpy(sun.sun_path, path, sizeof(sun.sun_path)); | 27 | strncpy(su.sun_path, path, sizeof(su.sun_path)); |
| 28 | 28 | ||
| 29 | unlink(path); | 29 | unlink(path); |
| 30 | 30 | ||
| 31 | if (bind(rs, (struct sockaddr *)&sun, sizeof(sun)) == -1) { | 31 | if (bind(rs, (struct sockaddr *)&su, sizeof(su)) == -1) { |
| 32 | close(rs); | 32 | close(rs); |
| 33 | return -1; | 33 | return -1; |
| 34 | } | 34 | } |
| @@ -58,12 +58,12 @@ int xs_unix_socket_connect(const char *path) | |||
| 58 | int d = -1; | 58 | int d = -1; |
| 59 | 59 | ||
| 60 | if ((d = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { | 60 | if ((d = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { |
| 61 | struct sockaddr_un sun = {0}; | 61 | struct sockaddr_un su = {0}; |
| 62 | 62 | ||
| 63 | sun.sun_family = AF_UNIX; | 63 | su.sun_family = AF_UNIX; |
| 64 | strncpy(sun.sun_path, path, sizeof(sun.sun_path)); | 64 | strncpy(su.sun_path, path, sizeof(su.sun_path)); |
| 65 | 65 | ||
| 66 | if (connect(d, (struct sockaddr *)&sun, sizeof(sun)) == -1) { | 66 | if (connect(d, (struct sockaddr *)&su, sizeof(su)) == -1) { |
| 67 | close(d); | 67 | close(d); |
| 68 | d = -1; | 68 | d = -1; |
| 69 | } | 69 | } |
diff --git a/xs_version.h b/xs_version.h index 716dba6..4318c7e 100644 --- a/xs_version.h +++ b/xs_version.h | |||
| @@ -1 +1 @@ | |||
| /* 7c7c38b6d14c07cb85698223bcff4d3193245437 2024-08-11T21:48:09+02:00 */ | /* c6eca9593f9b3d6791cba600e5950f682fdb36cf 2024-08-12T16:08:37+02:00 */ | ||