summaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-local.c
diff options
context:
space:
mode:
authorHarsh Prateek Bora <harsh@linux.vnet.ibm.com>2011-05-18 17:23:00 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-08-22 09:44:52 +0530
commit5f524c1ebcc5e0dec0de8940d34f9adb3c7887a1 (patch)
tree05be96a33cb9e8cde3b4c39ab69217adfa627ba2 /hw/9pfs/virtio-9p-local.c
parentd208a0e00598d19abab7cb6dc97cf21d7bf0eede (diff)
downloadqemu-5f524c1ebcc5e0dec0de8940d34f9adb3c7887a1.tar.gz
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/virtio-9p-local.c')
-rw-r--r--hw/9pfs/virtio-9p-local.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index 77904c37bd..61cbf8db14 100644
--- a/hw/9pfs/virtio-9p-local.c
+++ b/hw/9pfs/virtio-9p-local.c
@@ -165,9 +165,10 @@ static off_t local_telldir(FsContext *ctx, DIR *dir)
return telldir(dir);
}
-static struct dirent *local_readdir(FsContext *ctx, DIR *dir)
+static int local_readdir_r(FsContext *ctx, DIR *dir, struct dirent *entry,
+ struct dirent **result)
{
- return readdir(dir);
+ return readdir_r(dir, entry, result);
}
static void local_seekdir(FsContext *ctx, DIR *dir, off_t off)
@@ -532,7 +533,7 @@ FileOperations local_ops = {
.opendir = local_opendir,
.rewinddir = local_rewinddir,
.telldir = local_telldir,
- .readdir = local_readdir,
+ .readdir_r = local_readdir_r,
.seekdir = local_seekdir,
.preadv = local_preadv,
.pwritev = local_pwritev,