diff options
author | Harsh Prateek Bora <harsh@linux.vnet.ibm.com> | 2011-05-18 17:23:00 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-22 09:44:52 +0530 |
commit | 5f524c1ebcc5e0dec0de8940d34f9adb3c7887a1 (patch) | |
tree | 05be96a33cb9e8cde3b4c39ab69217adfa627ba2 /hw/9pfs/codir.c | |
parent | d208a0e00598d19abab7cb6dc97cf21d7bf0eede (diff) |
use readdir_r instead of readdir for reentrancy
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/codir.c')
-rw-r--r-- | hw/9pfs/codir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 0c31db3cbc..3a257b9027 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -17,16 +17,16 @@ #include "qemu-coroutine.h" #include "virtio-9p-coth.h" -int v9fs_co_readdir(V9fsState *s, V9fsFidState *fidp, struct dirent **dent) +int v9fs_co_readdir_r(V9fsState *s, V9fsFidState *fidp, struct dirent *dent, + struct dirent **result) { int err; v9fs_co_run_in_worker( { errno = 0; - /*FIXME!! need to switch to readdir_r */ - *dent = s->ops->readdir(&s->ctx, fidp->fs.dir); - if (!*dent && errno) { + err = s->ops->readdir_r(&s->ctx, fidp->fs.dir, dent, result); + if (!*result && errno) { err = -errno; } else { err = 0; |