[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
- [Qemu-devel] Make 9pfs buildable for Windows, Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 03/18] Disable the proxy fsdev under Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 01/18] Add definitions needed by file-op-9p.h for Windows, Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 04/18] Don't include sys/resource.h on Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 08/18] Stub 9pfs xattr functions for Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 05/18] Add definitions for 9p.c., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 06/18] Stub out functions for 9pfs., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 14/18] Disable rlimit under Windows, Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 15/18] Fix unavailable fields in stbuf under Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 16/18] Workaround for missing dent->d_type/d_off under Windows,
Michael Fritscher <=
- [Qemu-devel] [PATCH 07/18] Fix unused variable error and unsuded function if FS_IOC_GETVERSION is not defined., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 02/18] #include <sys/vfs.h> is not available under Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 17/18] Compile fixes for Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 12/18] Buildfix in 9p-util.c., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 18/18] Enable 9pfs for Windows in configure / makefiles, Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 11/18] Sete ctx->xops to null on Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 10/18] dirent has no d_off on Windows., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 13/18] fsetxattrat_nofollow doesn't seem to be defined on Windows - disable it., Michael Fritscher, 2017/09/29
- [Qemu-devel] [PATCH 09/18] Dont initialize fields which aren't available on Windows., Michael Fritscher, 2017/09/29
- Re: [Qemu-devel] Make 9pfs buildable for Windows, Paolo Bonzini, 2017/09/29