From 635324e83e238598e86628dba5ab62ce910e6f72 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 6 Jun 2016 11:52:34 +0200 Subject: 9p: switch back to readdir() This patch changes the 9p code to use readdir() again instead of readdir_r(), which is deprecated in glibc 2.24. All the locking was put in place by a previous patch. Reviewed-by: Eric Blake Signed-off-by: Greg Kurz --- hw/9pfs/codir.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'hw/9pfs/codir.c') diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 8e3ba17bae..d91f9ad6eb 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -17,8 +17,7 @@ #include "qemu/coroutine.h" #include "coth.h" -int v9fs_co_readdir_r(V9fsPDU *pdu, V9fsFidState *fidp, struct dirent *dent, - struct dirent **result) +int v9fs_co_readdir(V9fsPDU *pdu, V9fsFidState *fidp, struct dirent **dent) { int err; V9fsState *s = pdu->s; @@ -28,11 +27,14 @@ int v9fs_co_readdir_r(V9fsPDU *pdu, V9fsFidState *fidp, struct dirent *dent, } v9fs_co_run_in_worker( { + struct dirent *entry; + errno = 0; - err = s->ops->readdir_r(&s->ctx, &fidp->fs, dent, result); - if (!*result && errno) { + entry = s->ops->readdir(&s->ctx, &fidp->fs); + if (!entry && errno) { err = -errno; } else { + *dent = entry; err = 0; } }); -- cgit v1.2.3