9pfs: fix compilation errors on Mac OS X. 32/29432/2
authorKitae Kim <kt920.kim@samsung.com>
Tue, 28 Oct 2014 01:52:53 +0000 (10:52 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Tue, 28 Oct 2014 02:03:23 +0000 (10:03 +0800)
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 <kt920.kim@samsung.com>
hw/9pfs/virtio-9p-local-maru.c

index 6b00104..21406a0 100644 (file)
@@ -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) {