From f598a9333299b4dfb58ebb44e1762bce3983cbd7 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 21:36:09 +0100 Subject: [PATCH] Fix signedness warning in gio/glocalfileinfo.c:get_access_rights() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/glocalfileinfo.c: In function ‘get_access_rights’: gio/glocalfileinfo.c:932:9: error: comparison of integer expressions of different signedness: ‘uid_t’ {aka ‘unsigned int’} and ‘int’ 932 | uid == parent_info->owner || | ^~ --- gio/glocalfileinfo.c | 2 +- gio/glocalfileinfo.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 94de17057..33c224186 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -929,7 +929,7 @@ get_access_rights (GFileAttributeMatcher *attribute_matcher, uid_t uid = geteuid (); if (uid == _g_stat_uid (statbuf) || - uid == parent_info->owner || + uid == (uid_t) parent_info->owner || uid == 0) writable = TRUE; } diff --git a/gio/glocalfileinfo.h b/gio/glocalfileinfo.h index ff3e4994f..e04e921f2 100644 --- a/gio/glocalfileinfo.h +++ b/gio/glocalfileinfo.h @@ -46,6 +46,7 @@ typedef struct gboolean writable; gboolean is_sticky; gboolean has_trash_dir; + /* owner should be uid_t but it breaks compliance with MS-Windows */ int owner; dev_t device; ino_t inode;