[exim-cvs] kevent: handle OpenBSD API anomaly, redux

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] kevent: handle OpenBSD API anomaly, redux
Gitweb: https://git.exim.org/exim.git/commitdiff/22a7eb21aaf6d6858503890bb05c376fd6e37049
Commit:     22a7eb21aaf6d6858503890bb05c376fd6e37049
Parent:     a75ebe0dcc5faeb915cacb0d9db66d2475789116
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Nov 2 22:31:34 2020 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Nov 2 22:31:34 2020 +0000


    kevent: handle OpenBSD API anomaly, redux
---
 src/src/tls.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)


diff --git a/src/src/tls.c b/src/src/tls.c
index c088c7d..e6bf1c8 100644
--- a/src/src/tls.c
+++ b/src/src/tls.c
@@ -163,6 +163,7 @@ int fd1, fd2, i, cnt = 0;
struct stat sb;
#ifdef OpenBSD
struct kevent k_dummy;
+struct timespec ts = {0};
#endif

errno = 0;
@@ -215,14 +216,13 @@ for (;;)
store_release_above(s+1);
}

-if (kevent(tls_watch_fd, &kev[kev_used-cnt], cnt,
 #ifdef OpenBSD
-        &k_dummy, 1,
+if (kevent(tls_watch_fd, &kev[kev_used-cnt], cnt, &k_dummy, 1, &ts) >= 0)
+  return TRUE;
 #else
-        NULL, 0,
-#endif
-        NULL) >= 0)
+if (kevent(tls_watch_fd, &kev[kev_used-cnt], cnt, NULL, 0, NULL) >= 0)
   return TRUE;
+#endiv
 s = US"kevent";


bad: