Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Fix uv__to_stat function on Nuttx with newer gcc (#100)
Browse files Browse the repository at this point in the history
With a newer arm gcc (5.0+) the _DEFAULT_SOURCE macro
gets defined when the unix/fs.c file is built thus
trying to access a set of stat struct members which
are not defined on Nuttx.

By adding an extra check to see if the build is for
Nuttx we can correctly select the stat conversion
code path.

libtuv-DCO-1.0-Signed-off-by: Peter Gal [email protected]
  • Loading branch information
galpeter authored and yichoi committed Nov 22, 2017
1 parent de15e05 commit 2b3f4f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst->st_birthtim.tv_nsec = src->st_ctimensec;
dst->st_flags = 0;
dst->st_gen = 0;
#elif !defined(_AIX) && ( \
defined(_GNU_SOURCE) || \
#elif !defined(_AIX) && !defined(__NUTTX__) && \
(defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
defined(_XOPEN_SOURCE) || \
Expand Down

0 comments on commit 2b3f4f5

Please sign in to comment.