kernel: devfs: 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 device does not have Select(). Bug: 13965
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
#include <util/AutoLock.h>
|
#include <util/AutoLock.h>
|
||||||
#include <vfs.h>
|
#include <vfs.h>
|
||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
|
#include <wait_for_objects.h>
|
||||||
|
|
||||||
#include "BaseDevice.h"
|
#include "BaseDevice.h"
|
||||||
#include "FileDevice.h"
|
#include "FileDevice.h"
|
||||||
@@ -1552,8 +1553,12 @@ devfs_select(fs_volume* _volume, fs_vnode* _vnode, void* _cookie,
|
|||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
|
|
||||||
// If the device has no select() hook, notify select() now.
|
// If the device has no select() hook, notify select() now.
|
||||||
if (!vnode->stream.u.dev.device->HasSelect())
|
if (!vnode->stream.u.dev.device->HasSelect()) {
|
||||||
return notify_select_event((selectsync*)sync, event);
|
if (!SELECT_TYPE_IS_OUTPUT_ONLY(event))
|
||||||
|
return notify_select_event((selectsync*)sync, event);
|
||||||
|
else
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
return vnode->stream.u.dev.device->Select(cookie->device_cookie, event,
|
return vnode->stream.u.dev.device->Select(cookie->device_cookie, event,
|
||||||
(selectsync*)sync);
|
(selectsync*)sync);
|
||||||
|
|||||||
Reference in New Issue
Block a user