[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't sup
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't support futimens |
Date: |
Thu, 6 Oct 2011 22:29:50 +0530 |
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
hw/9pfs/virtio-9p-handle.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c
index 860b0e3..9860a87 100644
--- a/hw/9pfs/virtio-9p-handle.c
+++ b/hw/9pfs/virtio-9p-handle.c
@@ -386,12 +386,17 @@ static int handle_utimensat(FsContext *ctx, V9fsPath
*fs_path,
int fd, ret;
struct handle_data *data = (struct handle_data *)ctx->private;
+#ifdef CONFIG_UTIMENSAT
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
return fd;
}
ret = futimens(fd, buf);
close(fd);
+#else
+ ret = -1;
+ errno = ENOSYS;
+#endif
return ret;
}
@@ -591,8 +596,15 @@ static int handle_init(FsContext *ctx)
int ret, mnt_id;
struct statfs stbuf;
struct file_handle fh;
- struct handle_data *data = g_malloc(sizeof(struct handle_data));
+ struct handle_data *data;
+#ifndef CONFIG_UTIMENSAT
+ /*
+ * We support handle fs driver only if futimens is provided by the host
+ */
+ return -1;
+#endif
+ data = g_malloc(sizeof(struct handle_data));
data->mountfd = open(ctx->fs_root, O_DIRECTORY);
if (data->mountfd < 0) {
ret = data->mountfd;
--
1.7.4.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't support futimens,
Aneesh Kumar K.V <=