termux-packages/x11-packages/qemu-system-x86_64/qemu-3.0.0_hw_9pfs_9p-proxy.c.patch

38 lines
1000 B
Diff
Raw Normal View History

2018-10-26 16:21:47 +02:00
diff -uNr qemu-3.0.0/hw/9pfs/9p-proxy.c qemu-3.0.0.mod/hw/9pfs/9p-proxy.c
--- qemu-3.0.0/hw/9pfs/9p-proxy.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/hw/9pfs/9p-proxy.c 2018-10-26 17:09:13.395768387 +0300
@@ -674,9 +674,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 proxy_telldir(FsContext *ctx, V9fsFidOpenState *fs)
{
- return telldir(fs->dir.stream);
+ return android_telldir(fs->dir.stream);
}
static struct dirent *proxy_readdir(FsContext *ctx, V9fsFidOpenState *fs)
@@ -686,7 +700,7 @@
static void proxy_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
{
- seekdir(fs->dir.stream, off);
+ android_seekdir(fs->dir.stream, off);
}
static ssize_t proxy_preadv(FsContext *ctx, V9fsFidOpenState *fs,