File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1807,12 +1807,6 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
18071807#include <fcntl.h>
18081808#include <errno.h>
18091809
1810- /* Fall back to no-op if EFD_CLOEXEC is unavailable. */
1811- #ifndef EFD_CLOEXEC
1812- #define EFD_CLOEXEC 0
1813- #endif
1814-
1815-
18161810#ifndef max
18171811 static WC_INLINE int max (int a , int b )
18181812 {
@@ -1846,12 +1840,15 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
18461840
18471841 WOLFSSL_ENTER ("DoMonitor" );
18481842
1843+ #ifdef EFD_CLOEXEC
18491844 crl -> mfd = eventfd (0 , EFD_CLOEXEC ); /* our custom shutdown event */
1850- #ifdef FD_CLOEXEC
1851- if (crl -> mfd < 0 && errno == EINVAL ) {
1845+ if (crl -> mfd < 0 && (errno == ENOSYS || errno == EINVAL )) {
18521846 crl -> mfd = eventfd (0 , 0 );
18531847 wc_set_cloexec (crl -> mfd );
18541848 }
1849+ #else
1850+ crl -> mfd = eventfd (0 , 0 ); /* our custom shutdown event */
1851+ wc_set_cloexec (crl -> mfd );
18551852#endif
18561853 if (crl -> mfd < 0 ) {
18571854 WOLFSSL_MSG ("eventfd failed" );
Original file line number Diff line number Diff line change 3333#include <fcntl.h>
3434#include <sys/ioctl.h>
3535#include <devctl.h>
36+ #include <errno.h>
3637
3738
3839/* for devctl use */
You can’t perform that action at this time.
0 commit comments