mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-24 16:43:36 +00:00
Variable renaming in xs_unix_socket, because it collides in Illumos.
This commit is contained in:
parent
45278afdf1
commit
755fdbd737
2 changed files with 9 additions and 9 deletions
|
@ -20,15 +20,15 @@ int xs_unix_socket_server(const char *path, const char *grp)
|
|||
int rs = -1;
|
||||
|
||||
if ((rs = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
|
||||
struct sockaddr_un sun = {0};
|
||||
struct sockaddr_un su = {0};
|
||||
mode_t mode = 0666;
|
||||
|
||||
sun.sun_family = AF_UNIX;
|
||||
strncpy(sun.sun_path, path, sizeof(sun.sun_path));
|
||||
su.sun_family = AF_UNIX;
|
||||
strncpy(su.sun_path, path, sizeof(su.sun_path));
|
||||
|
||||
unlink(path);
|
||||
|
||||
if (bind(rs, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
|
||||
if (bind(rs, (struct sockaddr *)&su, sizeof(su)) == -1) {
|
||||
close(rs);
|
||||
return -1;
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ int xs_unix_socket_connect(const char *path)
|
|||
int d = -1;
|
||||
|
||||
if ((d = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) {
|
||||
struct sockaddr_un sun = {0};
|
||||
struct sockaddr_un su = {0};
|
||||
|
||||
sun.sun_family = AF_UNIX;
|
||||
strncpy(sun.sun_path, path, sizeof(sun.sun_path));
|
||||
su.sun_family = AF_UNIX;
|
||||
strncpy(su.sun_path, path, sizeof(su.sun_path));
|
||||
|
||||
if (connect(d, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
|
||||
if (connect(d, (struct sockaddr *)&su, sizeof(su)) == -1) {
|
||||
close(d);
|
||||
d = -1;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
/* 7c7c38b6d14c07cb85698223bcff4d3193245437 2024-08-11T21:48:09+02:00 */
|
||||
/* c6eca9593f9b3d6791cba600e5950f682fdb36cf 2024-08-12T16:08:37+02:00 */
|
||||
|
|
Loading…
Reference in a new issue