[glib: 2/6] Fix signedness warning in gio/glocalfileinfo.c:get_access_rights()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/6] Fix signedness warning in gio/glocalfileinfo.c:get_access_rights()
- Date: Tue, 9 Feb 2021 10:45:53 +0000 (UTC)
commit f598a9333299b4dfb58ebb44e1762bce3983cbd7
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Tue Nov 17 21:36:09 2020 +0100
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 ||
| ^~
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]