blob: 47d9114ed131e0defe3cce94d02e2cbcec9bdd0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
Index: scheduler/select.c
===================================================================
--- scheduler/select.c (revision 8887)
+++ scheduler/select.c (working copy)
@@ -454,7 +454,7 @@
if (fdptr->read_cb && event->filter == EVFILT_READ)
(*(fdptr->read_cb))(fdptr->data);
- if (fdptr->write_cb && event->filter == EVFILT_WRITE)
+ if (fdptr->use > 1 && fdptr->write_cb && event->filter == EVFILT_WRITE)
(*(fdptr->write_cb))(fdptr->data);
release_fd(fdptr);
@@ -499,7 +499,8 @@
if (fdptr->read_cb && (event->events & (EPOLLIN | EPOLLERR | EPOLLHUP)))
(*(fdptr->read_cb))(fdptr->data);
- if (fdptr->write_cb && (event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
+ if (fdptr->use > 1 && fdptr->write_cb &&
+ (event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
(*(fdptr->write_cb))(fdptr->data);
release_fd(fdptr);
@@ -590,7 +591,8 @@
if (fdptr->read_cb && (pfd->revents & (POLLIN | POLLERR | POLLHUP)))
(*(fdptr->read_cb))(fdptr->data);
- if (fdptr->write_cb && (pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
+ if (fdptr->use > 1 && fdptr->write_cb &&
+ (pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
(*(fdptr->write_cb))(fdptr->data);
release_fd(fdptr);
@@ -645,7 +647,8 @@
if (fdptr->read_cb && FD_ISSET(fdptr->fd, &cupsd_current_input))
(*(fdptr->read_cb))(fdptr->data);
- if (fdptr->write_cb && FD_ISSET(fdptr->fd, &cupsd_current_output))
+ if (fdptr->use > 1 && fdptr->write_cb &&
+ FD_ISSET(fdptr->fd, &cupsd_current_output))
(*(fdptr->write_cb))(fdptr->data);
release_fd(fdptr);
|