From 14506b4c2f8b0541a00a18ca8d6dc43462a33326 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 11 Dec 2017 09:16:18 +0100 Subject: [PATCH] Fix -Wsign-compare warnings on cross compiling for android Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104022 Signed-off-by: Ralf Habacker --- dbus/dbus-sysdeps-unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 9f859845..5dcab298 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1770,7 +1770,7 @@ add_linux_security_label_to_credentials (int client_fd, _dbus_verbose ("getsockopt failed with %s, len now %lu\n", _dbus_strerror (e), (unsigned long) len); - if (e != ERANGE || len <= _dbus_string_get_length_uint (&buf)) + if (e != ERANGE || (unsigned int)len <= _dbus_string_get_length_uint (&buf)) { _dbus_verbose ("Failed to getsockopt(SO_PEERSEC): %s\n", _dbus_strerror (e)); @@ -1795,7 +1795,7 @@ add_linux_security_label_to_credentials (int client_fd, goto out; } - if (len > _dbus_string_get_length_uint (&buf)) + if ((unsigned int)len > _dbus_string_get_length_uint (&buf)) { _dbus_verbose ("%lu > %u", (unsigned long) len, _dbus_string_get_length_uint (&buf)); @@ -1817,7 +1817,7 @@ add_linux_security_label_to_credentials (int client_fd, goto out; } - if (strlen (_dbus_string_get_const_data (&buf)) != len) + if (strlen (_dbus_string_get_const_data (&buf)) != (unsigned int)len) { /* LSM people on the linux-security-module@ mailing list say this * should never happen: the label should be a bytestring with -- 2.12.3