From 46d186acafd472e3c43e6f0fab4567148ac32a64 Mon Sep 17 00:00:00 2001 From: Kitae Kim Date: Tue, 28 Oct 2014 10:52:53 +0900 Subject: [PATCH] 9pfs: fix compilation errors on Mac OS X. in case of Mac OS X, mode_t type is unsigned short. So, -1 cannot be compared to mode_t type. Change-Id: Iad1e4a1049e14de0575ed6da11b339ed9045b12d Signed-off-by: Kitae Kim --- hw/9pfs/virtio-9p-local-maru.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/virtio-9p-local-maru.c b/hw/9pfs/virtio-9p-local-maru.c index 6b00104..21406a0 100644 --- a/hw/9pfs/virtio-9p-local-maru.c +++ b/hw/9pfs/virtio-9p-local-maru.c @@ -334,9 +334,8 @@ update_map_file: if (credp->fc_gid != -1) { gid = credp->fc_gid; } -// FIXME #ifndef CONFIG_WIN32 - if (credp->fc_mode != -1) { + if (credp->fc_mode != (mode_t)-1) { mode = credp->fc_mode; } #else @@ -420,7 +419,7 @@ static int local_set_xattr(const char *path, FsCred *credp) return err; } } - if (credp->fc_mode != -1) { + if (credp->fc_mode != (mode_t)-1) { err = setxattr(path, "user.virtfs.mode", &credp->fc_mode, sizeof(mode_t), 0, 0); if (err) { -- 2.7.4