mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
Merge pull request #874 from yohanesu75/ipc-client-fix
Fix to make ipc client code FreeBSD compatible.
This commit is contained in:
commit
050704ab23
@ -34,7 +34,7 @@ int ipc_open_socket(const char *socket_path) {
|
|||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path));
|
strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path));
|
||||||
addr.sun_path[sizeof(addr.sun_path) - 1] = 0;
|
addr.sun_path[sizeof(addr.sun_path) - 1] = 0;
|
||||||
int l = sizeof(addr.sun_family) + strlen(addr.sun_path);
|
int l = sizeof(struct sockaddr_un);
|
||||||
if (connect(socketfd, (struct sockaddr *)&addr, l) == -1) {
|
if (connect(socketfd, (struct sockaddr *)&addr, l) == -1) {
|
||||||
sway_abort("Unable to connect to %s", socket_path);
|
sway_abort("Unable to connect to %s", socket_path);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user