summaryrefslogtreecommitdiff
path: root/kernel/poll.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/poll.c')
-rw-r--r--kernel/poll.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/poll.c b/kernel/poll.c
index 7107646..4c6e411 100644
--- a/kernel/poll.c
+++ b/kernel/poll.c
@@ -57,11 +57,15 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {
fds[i].revents |= POLLHUP;
}
} else {
- if (f->inode->has_data && fds[i].events & POLLIN) {
- fds[i].revents |= POLLIN;
+ if (f->inode->_has_data) {
+ if (f->inode->_has_data(f->inode) && fds[i].events & POLLIN) {
+ fds[i].revents |= POLLIN;
+ }
}
- if (f->inode->can_write && fds[i].events & POLLOUT) {
- fds[i].revents |= POLLOUT;
+ if (f->inode->_can_write) {
+ if (f->inode->_can_write(f->inode) && fds[i].events & POLLOUT) {
+ fds[i].revents |= POLLOUT;
+ }
}
if (!(f->inode->is_open) && fds[i].events & POLLHUP) {
fds[i].revents |= POLLHUP;