From 9bc62dd3a7d60eb69f471d693562e4ba3a54365b Mon Sep 17 00:00:00 2001 From: guenther Date: Wed, 6 Aug 2014 19:31:30 +0000 Subject: [PATCH] Support NOTE_EOF for kqueue EVFILT_READ filters on NFS files. committing for jsg@, ok reyk@ tedu@ guenther@ --- sys/nfs/nfs_kq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index aac0be74626..00cc0f9e51f 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.20 2014/07/12 18:43:52 tedu Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.21 2014/08/06 19:31:30 guenther Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -230,6 +230,10 @@ filt_nfsread(struct knote *kn, long hint) #ifdef DEBUG printf("nfsread event. %lld\n", kn->kn_data); #endif + if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) { + kn->kn_fflags |= NOTE_EOF; + return (1); + } return (kn->kn_data != 0); } -- 2.20.1