vitrio-9p: enable the virtio-9p on windows. 58/21358/1
authorSooyoung Ha <yoosah.ha@samsung.com>
Mon, 19 May 2014 08:49:32 +0000 (17:49 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Mon, 19 May 2014 08:49:32 +0000 (17:49 +0900)
Fix the virtfs-9p build failure on some windows environment and enable it.
The old-version MinGW's 'struct dirent' doesn't support 'd_type' member. This d_type has the information of the file type, but it's not mandatory. The other api can get the file type information. So d_type is to be always zero on windows.(zero means unknown type)

Change-Id: I1c657134bbc6188a7d6a9cfc2534664efe3ceea4
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
hw/9pfs/virtio-9p-maru.c
package/build.windows-32

index 63bc271..9556dbd 100644 (file)
@@ -45,6 +45,9 @@
 #define major(x) 0
 #define minor(x) 0
 
+/* Old MinGW's struct dirent doesn't support d_type member */
+#define WIN32_D_TYPE 0
+
 extern uint64_t hostBytesPerSector;
 #endif
 
@@ -1984,9 +1987,15 @@ static int v9fs_do_readdir(V9fsPDU *pdu,
                           dent->d_type, &name);
 #else
         d_offset = v9fs_co_telldir(pdu, fidp);
+#ifndef CONFIG_WIN32
         len = pdu_marshal(pdu, 11 + count, "Qqbs",
                           &qid, d_offset,
                           dent->d_type, &name);
+#else
+        len = pdu_marshal(pdu, 11 + count, "Qqbs",
+                          &qid, d_offset,
+                          WIN32_D_TYPE, &name);
+#endif
 #endif
         if (len < 0) {
             v9fs_co_seekdir(pdu, fidp, saved_dir_pos);
index b252c50..3e73bc0 100755 (executable)
@@ -56,7 +56,7 @@ build()
        prepare
 
        cd $SRCDIR/tizen
-       ./emulator_configure.sh x86 -e --disable-virtfs -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
+       ./emulator_configure.sh x86 -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
        make all_dibs
        if [ $? -eq 0 ]
        then