From e4e9b9d8d7d474613bfc176c0ff190a5b59d4d5b Mon Sep 17 00:00:00 2001 From: Nicholas Lowell Date: Mon, 10 Feb 2020 14:33:29 -0500 Subject: [PATCH] posix: fix unistd.h extern C brace mismatch If unistd.h is included while CONFIG_POSIX_API is not defined, there is a mismatch of extern C braces that will cause compile errors Signed-off-by: Nicholas Lowell --- include/posix/unistd.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/posix/unistd.h b/include/posix/unistd.h index d130ea6228a..e9c955c5bf0 100644 --- a/include/posix/unistd.h +++ b/include/posix/unistd.h @@ -15,11 +15,13 @@ #ifdef CONFIG_POSIX_API #include +#endif #ifdef __cplusplus extern "C" { #endif +#ifdef CONFIG_POSIX_API /* File related operations */ extern int close(int file); extern ssize_t write(int file, const void *buffer, size_t count); @@ -37,9 +39,9 @@ static inline int gethostname(char *buf, size_t len) { return zsock_gethostname(buf, len); } -#endif +#endif /* CONFIG_NETWORKING */ -#endif +#endif /* CONFIG_POSIX_API */ unsigned sleep(unsigned int seconds); int usleep(useconds_t useconds);