* [Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't support futimens
@ 2011-10-06 16:59 Aneesh Kumar K.V
0 siblings, 0 replies; only message in thread
From: Aneesh Kumar K.V @ 2011-10-06 16:59 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-06 17:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 16:59 [Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't support futimens Aneesh Kumar K.V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).