hw/9pfs: Fix build error on platform that don't support futimens
PATCH 1/1 hw/9pfs: Fix build error on platform that don't support futimens
Signed-off-by Aneesh Kumar K.V <[email protected]>
--- hw/9pfs/virtio-9p-handle.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
hw/9pfs/virtio-9p-handle.c +13 -1
@@ -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;
Signature · 1 line
1.7.4.1