Fix #684: incompatible pointer types passing struct sockaddr_un
authorColin Clark <colin.clark@cclark.uk>
Tue, 26 Apr 2022 16:14:43 +0000 (17:14 +0100)
committerColin Clark <colin.clark@cclark.uk>
Tue, 26 Apr 2022 16:14:43 +0000 (17:14 +0100)
https://github.com/BestImageViewer/geeqie/issues/684

incompatible pointer types passing 'struct sockaddr_un *' to parameter
of type 'const struct sockaddr *'

src/remote.c

index 2f4b88f..ac1dac9 100644 (file)
@@ -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, (struct sockaddr*)&addr, sizeof(addr)) == -1 ||
+       if (bind(fd, (const struct sockaddr*)&addr, sizeof(addr)) == -1 ||
            listen(fd, REMOTE_SERVER_BACKLOG) == -1)
                {
                log_printf("error subscribing to socket: %s\n", strerror(errno));