summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2021-06-18 17:38:27 (GMT)
committerdgp <dgp@users.sourceforge.net>2021-06-18 17:38:27 (GMT)
commit9deb1f2b0abf590ec9551280107b2c365a4688cd (patch)
tree267734daeb1b077a8023c8b729432b230d5f5430 /unix
parenta8606e7ce991094c3eb294342659e21532761b93 (diff)
parent7dd17bbcbf3f6795924aa51f56cc7810cafc30c1 (diff)
downloadtcl-9deb1f2b0abf590ec9551280107b2c365a4688cd.zip
tcl-9deb1f2b0abf590ec9551280107b2c365a4688cd.tar.gz
tcl-9deb1f2b0abf590ec9551280107b2c365a4688cd.tar.bz2
close fork
Diffstat (limited to 'unix')
-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;
}
/*