qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 16/18] Workaround for missing dent->d_type/d_off und


From: Michael Fritscher
Subject: [Qemu-devel] [PATCH 16/18] Workaround for missing dent->d_type/d_off under Windows
Date: Fri, 29 Sep 2017 13:13:21 +0200

Signed-off-by: Michael Fritscher <address@hidden>
---
 hw/9pfs/9p.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index f4ccb45f64..4e07bfc71b 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -1794,7 +1794,11 @@ static int coroutine_fn 
v9fs_do_readdir_with_stat(V9fsPDU *pdu,
         count += len;
         v9fs_stat_free(&v9stat);
         v9fs_path_free(&path);
+#ifdef _WIN32
+        saved_dir_pos = v9fs_co_telldir(pdu, fidp);
+#else
         saved_dir_pos = dent->d_off;
+#endif
     }
 
     v9fs_readdir_unlock(&fidp->fs.dir);
@@ -1946,9 +1950,15 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu, 
V9fsFidState *fidp,
         qid.version = 0;
 
         /* 11 = 7 + 4 (7 = start offset, 4 = space for storing count) */
+#ifdef _WIN32
+        len = pdu_marshal(pdu, 11 + count, "Qqbs",
+                          &qid, v9fs_co_telldir(pdu, fidp),
+                          DT_UNKNOWN, &name);
+#else
         len = pdu_marshal(pdu, 11 + count, "Qqbs",
                           &qid, dent->d_off,
                           dent->d_type, &name);
+#endif
 
         v9fs_readdir_unlock(&fidp->fs.dir);
 
@@ -1959,7 +1969,11 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu, 
V9fsFidState *fidp,
         }
         count += len;
         v9fs_string_free(&name);
+#ifdef _WIN32
+        saved_dir_pos = v9fs_co_telldir(pdu, fidp);
+#else
         saved_dir_pos = dent->d_off;
+#endif
     }
 
     v9fs_readdir_unlock(&fidp->fs.dir);
-- 
2.13.2.windows.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]