From 7ea866b2aa83005b8a5374f16c1f856e0a53368b Mon Sep 17 00:00:00 2001 From: equal-l2 Date: Mon, 8 Feb 2021 09:29:39 +0900 Subject: [PATCH] Cast `struct sockaddr_un*` properly Because of `-Werror`, the difference in pointer types makes the whole build fail. --- src/remote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remote.c b/src/remote.c index f7a5a250..66e9f3be 100644 --- a/src/remote.c +++ b/src/remote.c @@ -264,7 +264,7 @@ static RemoteConnection *remote_server_open(const gchar *path) addr.sun_family = AF_UNIX; sun_path_len = MIN(strlen(path) + 1, UNIX_PATH_MAX); strncpy(addr.sun_path, path, sun_path_len); - if (bind(fd, &addr, sizeof(addr)) == -1 || + if (bind(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1 || listen(fd, REMOTE_SERVER_BACKLOG) == -1) { log_printf("error subscribing to socket: %s\n", strerror(errno)); @@ -313,7 +313,7 @@ static RemoteConnection *remote_client_open(const gchar *path) addr.sun_family = AF_UNIX; sun_path_len = MIN(strlen(path) + 1, UNIX_PATH_MAX); strncpy(addr.sun_path, path, sun_path_len); - if (connect(fd, &addr, sizeof(addr)) == -1) + if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) { DEBUG_1("error connecting to socket: %s", strerror(errno)); close(fd); -- 2.20.1