Skip to content

Commit 1b5d77e

Browse files
committed
Fix from review
1 parent e26ab42 commit 1b5d77e

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/crl.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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");

wolfcrypt/src/port/caam/wolfcaam_qnx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <fcntl.h>
3434
#include <sys/ioctl.h>
3535
#include <devctl.h>
36+
#include <errno.h>
3637

3738

3839
/* for devctl use */

0 commit comments

Comments
 (0)