summaryrefslogtreecommitdiffstats
path: root/unix/tclEpollNotfy.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-23 13:27:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-23 13:27:55 (GMT)
commitcbb66412ca40047eab4b424f4f86150f71b622d9 (patch)
tree52a5e0aa2fc7151657345a0a0cbbe4edd3802d23 /unix/tclEpollNotfy.c
parent20fcf335945daf5dedf6f10f940026b681dd7f1b (diff)
parent501954d5aaf9401f977885fd340298baacde61a2 (diff)
downloadtcl-cbb66412ca40047eab4b424f4f86150f71b622d9.zip
tcl-cbb66412ca40047eab4b424f4f86150f71b622d9.tar.gz
tcl-cbb66412ca40047eab4b424f4f86150f71b622d9.tar.bz2
Merge 8.7
Diffstat (limited to 'unix/tclEpollNotfy.c')
-rw-r--r--unix/tclEpollNotfy.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c
index 23c88b2..287dfe2 100644
--- a/unix/tclEpollNotfy.c
+++ b/unix/tclEpollNotfy.c
@@ -223,22 +223,29 @@ PlatformEventsControl(
if (fstat(filePtr->fd, &fdStat) == -1) {
Tcl_Panic("fstat: %s", strerror(errno));
- } else if ((fdStat.st_mode & S_IFMT) == S_IFREG) {
- switch (op) {
- case EPOLL_CTL_ADD:
- if (isNew) {
- LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr,
- readyNode);
- }
- break;
- case EPOLL_CTL_DEL:
- LIST_REMOVE(filePtr, readyNode);
- break;
+ }
+
+ if (epoll_ctl(tsdPtr->eventsFd, op, filePtr->fd, &newEvent) == -1) {
+ switch (errno) {
+ case EPERM:
+ switch (op) {
+ case EPOLL_CTL_ADD:
+ if (isNew) {
+ LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr,
+ readyNode);
+ }
+ break;
+ case EPOLL_CTL_DEL:
+ LIST_REMOVE(filePtr, readyNode);
+ break;
+
+ }
+ break;
+ default:
+ Tcl_Panic("epoll_ctl: %s", strerror(errno));
}
- return;
- } else if (epoll_ctl(tsdPtr->eventsFd, op, filePtr->fd, &newEvent) == -1) {
- Tcl_Panic("epoll_ctl: %s", strerror(errno));
- }
+ }
+ return;
}
/*