Skip to content

Commit 4c2958c

Browse files
committed
Trying to fix module_register_fd test on osx...
1 parent e683648 commit 4c2958c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Lib/module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ static int manage_fds(module *mod, m_context *c, int flag, int stop) {
459459
*/
460460
static int _poll_set_new_evt(module_poll_t *t, m_context *c, int flag) {
461461
int ret = poll_set_new_evt(t, c, flag);
462+
printf("Ret: %d, errno: %d\n", ret, errno);
462463
/* Workaround for STDIN_FILENO */
463464
if (ret == -1 && t->fd == STDIN_FILENO && errno == EPERM) {
464465
ret = 0;

Lib/poll_plugins/kqueue_priv.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ int poll_create(void) {
77
int fd;
88
#ifdef __APPLE__
99
fd = kqueue();
10-
// #ifdef FD_CLOEXEC
1110
fcntl(fd, F_SETFD, FD_CLOEXEC);
12-
// #endif
1311
#else
1412
fd = kqueue1(O_CLOEXEC);
1513
#endif
@@ -68,9 +66,7 @@ int _pipe(int fd[2]) {
6866
flags = 0;
6967
}
7068
fcntl(fd[i], F_SETFL, flags | O_NONBLOCK);
71-
// #ifdef FD_CLOEXEC
7269
fcntl(fd[i], F_SETFD, FD_CLOEXEC);
73-
// #endif
7470
}
7571
}
7672
return ret;

TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
- [x] Fix CMakeLists to runt tests even if valgrind could not be found
1212

13-
- [ ] Fix tests on osx? module_(de)register_fd fails
13+
- [ ] Fix tests on osx? module_register_fd fails
14+
- [x] Special handling of STDIN_FILENO in poll_set_new_evt: it returns EPERM but it is actually pollable.
1415

1516
## 3.1.0
1617

0 commit comments

Comments
 (0)