Commit e644bfa3 authored by Philip Withnall's avatar Philip Withnall

gio: Add some casts for printf() formatting statbufs on Solaris

Apparently Solaris defines statbuf fields as long when Linux doesn’t, in
some cases. Cast down to the type expected by the printf() format
placeholder.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749652
parent ae789500
......@@ -273,7 +273,7 @@ ensure_keyring_directory (GError **error)
G_IO_ERROR_FAILED,
_("Permissions on directory “%s” are malformed. Expected mode 0700, got 0%o"),
path,
statbuf.st_mode & 0777);
(guint) (statbuf.st_mode & 0777));
g_free (path);
path = NULL;
goto out;
......
......@@ -3481,10 +3481,10 @@ g_dbus_message_print (GDBusMessage *message,
{
#ifndef MAJOR_MINOR_NOT_FOUND
g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_dev), minor (statbuf.st_dev));
(gint) major (statbuf.st_dev), (gint) minor (statbuf.st_dev));
#endif
g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "",
statbuf.st_mode);
(guint) statbuf.st_mode);
g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_ino);
g_string_append_printf (fs, "%s" "uid=%u", fs->len > 0 ? "," : "",
......@@ -3493,7 +3493,7 @@ g_dbus_message_print (GDBusMessage *message,
(guint) statbuf.st_gid);
#ifndef MAJOR_MINOR_NOT_FOUND
g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_rdev), minor (statbuf.st_rdev));
(gint) major (statbuf.st_rdev), (gint) minor (statbuf.st_rdev));
#endif
g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment