kernel: vfs: don't notify output-only select events by default

Output-only events (B_EVENT_ERROR, B_EVENT_DISCONNECTED and
B_EVENT_INVALID, with B_EVENT_INVALID masked out before passing down
events) are used to indicate error, so they should not be notified if
the vnode does not have select().

Bug: 13965
This commit is contained in:
Xiang Fan 2018-01-21 00:15:39 +08:00 committed by Jérôme Duval
parent f3b05a74bb
commit a9388f6d39
1 changed files with 7 additions and 2 deletions

View File

@ -52,6 +52,7 @@
#include <vfs.h>
#include <vm/vm.h>
#include <vm/VMCache.h>
#include <wait_for_objects.h>
#include "EntryCache.h"
#include "fifo.h"
@ -5773,8 +5774,12 @@ file_select(struct file_descriptor* descriptor, uint8 event,
struct vnode* vnode = descriptor->u.vnode;
// If the FS has no select() hook, notify select() now.
if (!HAS_FS_CALL(vnode, select))
return notify_select_event(sync, event);
if (!HAS_FS_CALL(vnode, select)) {
if (!SELECT_TYPE_IS_OUTPUT_ONLY(event))
return notify_select_event(sync, event);
else
return B_OK;
}
return FS_CALL(vnode, select, descriptor->cookie, event, sync);
}