Skip to content

Commit

Permalink
Merge pull request #843 from pguyot/w40/fix-posix-errno-conditionals
Browse files Browse the repository at this point in the history
Fix posix errno conditionals
  • Loading branch information
fadushin committed Oct 6, 2023
2 parents 4564ebd + 302dff3 commit 8c7b768
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libAtomVM/posix_nifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

#if HAVE_OPEN && HAVE_CLOSE
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#endif
Expand All @@ -39,6 +38,10 @@
#include <sys/time.h>
#endif

#if HAVE_OPEN && HAVE_CLOSE || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_SETTIMEOFDAY)
#include <errno.h>
#endif

#include "defaultatoms.h"
#include "erl_nif_priv.h"
#include "globalcontext.h"
Expand All @@ -48,7 +51,7 @@

term posix_errno_to_term(int err, GlobalContext *glb)
{
#if HAVE_OPEN && HAVE_CLOSE
#if HAVE_OPEN && HAVE_CLOSE || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_SETTIMEOFDAY)
// These are defined in SUSv1
switch (err) {
case EACCES:
Expand Down

0 comments on commit 8c7b768

Please sign in to comment.