diff options
author | Emmanuel Fleury <emmanuel.fleury@gmail.com> | 2020-11-17 21:36:09 +0100 |
---|---|---|
committer | Emmanuel Fleury <emmanuel.fleury@gmail.com> | 2021-02-08 11:00:25 +0100 |
commit | f598a9333299b4dfb58ebb44e1762bce3983cbd7 (patch) | |
tree | b7c90f43d30170e21b6e61f465d32313b76c7d27 | |
parent | 4260193cff934e55cfe2903a4339c86a6d6d683e (diff) | |
download | glib-f598a9333299b4dfb58ebb44e1762bce3983cbd7.tar.gz |
Fix signedness warning in gio/glocalfileinfo.c:get_access_rights()
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 ||
| ^~
-rw-r--r-- | gio/glocalfileinfo.c | 2 | ||||
-rw-r--r-- | gio/glocalfileinfo.h | 1 |
2 files changed, 2 insertions, 1 deletions
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; |