mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
gio-launch-desktop: Fix -Wshorten-64-to-32 warning with socklen_t
`socklen_t` is defined as an `int`, but we’re putting a `size_t` sized value into it. Socket paths are guaranteed to fit in a `socklen_t`, so it’s OK to cast down. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3527
This commit is contained in:
@@ -129,7 +129,7 @@ journal_stream_fd (const char *identifier,
|
||||
if (fd < 0)
|
||||
goto fail;
|
||||
|
||||
salen = offsetof (struct sockaddr_un, sun_path) + strlen (sa.un.sun_path) + 1;
|
||||
salen = offsetof (struct sockaddr_un, sun_path) + (socklen_t) strlen (sa.un.sun_path) + 1;
|
||||
|
||||
if (connect (fd, &sa.sa, salen) < 0)
|
||||
goto fail;
|
||||
|
Reference in New Issue
Block a user