summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-02-19 10:22:20 +0000
committertedu <tedu@openbsd.org>2015-02-19 10:22:20 +0000
commit491c728cc77c8ff28f74749e5c77d877a8b4efcb (patch)
tree24e5dac59f611947e0e51406483b3b5d088e6c65 /sys/miscfs
parentTypo. (diff)
downloadwireguard-openbsd-491c728cc77c8ff28f74749e5c77d877a8b4efcb.tar.xz
wireguard-openbsd-491c728cc77c8ff28f74749e5c77d877a8b4efcb.zip
set the eofflag in readdir like we're supposed to.
from Martin Natano
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fuse/fuse_vnops.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c
index 43db6e28f96..f6807648338 100644
--- a/sys/miscfs/fuse/fuse_vnops.c
+++ b/sys/miscfs/fuse/fuse_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vnops.c,v 1.22 2015/02/10 21:56:10 miod Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.23 2015/02/19 10:22:20 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -686,7 +686,7 @@ fusefs_readdir(void *v)
struct vnode *vp;
struct proc *p;
struct uio *uio;
- int error = 0;
+ int error = 0, eofflag = 0;
vp = ap->a_vp;
uio = ap->a_uio;
@@ -720,8 +720,9 @@ fusefs_readdir(void *v)
break;
}
- /*ack end of readdir */
+ /* ack end of readdir */
if (fbuf->fb_len == 0) {
+ eofflag = 1;
fb_delete(fbuf);
break;
}
@@ -734,6 +735,9 @@ fusefs_readdir(void *v)
fb_delete(fbuf);
}
+ if (!error && ap->a_eofflag != NULL)
+ *ap->a_eofflag = eofflag;
+
return (error);
}