From 33adfac0b0549ca7e373d6206d03d65fbe078fcf Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Mon, 19 May 2014 17:49:32 +0900 Subject: [PATCH] vitrio-9p: enable the virtio-9p on windows. 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 --- hw/9pfs/virtio-9p-maru.c | 9 +++++++++ package/build.windows-32 | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/virtio-9p-maru.c b/hw/9pfs/virtio-9p-maru.c index 63bc271177..9556dbdad5 100644 --- a/hw/9pfs/virtio-9p-maru.c +++ b/hw/9pfs/virtio-9p-maru.c @@ -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); diff --git a/package/build.windows-32 b/package/build.windows-32 index b252c50c52..3e73bc0c36 100755 --- a/package/build.windows-32 +++ b/package/build.windows-32 @@ -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 -- 2.34.1