termux-packages/x11-packages/qemu-system-x86_64/qemu-3.0.0_hw_9pfs_9p-local.c.patch
2022-04-18 14:08:33 +05:30

38 lines
1005 B
Diff

diff -uNr qemu-3.0.0/hw/9pfs/9p-local.c qemu-3.0.0.mod/hw/9pfs/9p-local.c
--- qemu-3.0.0/hw/9pfs/9p-local.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/hw/9pfs/9p-local.c 2018-10-26 17:08:50.995577413 +0300
@@ -535,9 +535,23 @@
rewinddir(fs->dir.stream);
}
+struct DIR {
+ int fd_;
+};
+
+static long android_telldir(struct DIR *dirp)
+{
+ return (long) lseek(dirp->fd_, 0, SEEK_CUR);
+}
+
+static void android_seekdir(DIR *dirp, long loc)
+{
+ (void) lseek(dirp->fd_, loc, SEEK_SET);
+}
+
static off_t local_telldir(FsContext *ctx, V9fsFidOpenState *fs)
{
- return telldir(fs->dir.stream);
+ return android_telldir(fs->dir.stream);
}
static bool local_is_mapped_file_metadata(FsContext *fs_ctx, const char *name)
@@ -571,7 +585,7 @@
static void local_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
{
- seekdir(fs->dir.stream, off);
+ android_seekdir(fs->dir.stream, off);
}
static ssize_t local_preadv(FsContext *ctx, V9fsFidOpenState *fs,