aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs
diff options
context:
space:
mode:
authorKeno Fischer <keno@juliacomputing.com>2018-06-29 12:32:10 +0200
committerGreg Kurz <groug@kaod.org>2018-06-29 12:32:10 +0200
commit230f1b31c5d58a852e1ac46e1ef05cfa7d5d9280 (patch)
tree398e5b9258fdc9e0819ae9d14d47293ee6ac73fc /hw/9pfs
parent5c99fa375da1c7cc4a42a93e002e98b9fb34754b (diff)
9p: darwin: Explicitly cast comparisons of mode_t with -1
Comparisons of mode_t with -1 require an explicit cast, since mode_t is unsigned on Darwin. Signed-off-by: Keno Fischer <keno@juliacomputing.com> Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'hw/9pfs')
-rw-r--r--hw/9pfs/9p-local.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 828e8d6e56..c30f4f26bd 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -308,7 +308,7 @@ update_map_file:
if (credp->fc_gid != -1) {
gid = credp->fc_gid;
}
- if (credp->fc_mode != -1) {
+ if (credp->fc_mode != (mode_t)-1) {
mode = credp->fc_mode;
}
if (credp->fc_rdev != -1) {
@@ -414,7 +414,7 @@ static int local_set_xattrat(int dirfd, const char *path, FsCred *credp)
return err;
}
}
- if (credp->fc_mode != -1) {
+ if (credp->fc_mode != (mode_t)-1) {
uint32_t tmp_mode = cpu_to_le32(credp->fc_mode);
err = fsetxattrat_nofollow(dirfd, path, "user.virtfs.mode", &tmp_mode,
sizeof(mode_t), 0);