From ce41b2bc1fd6d99cbcb2c7cf131588b849855889 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 2 Nov 2015 21:12:57 +0100 Subject: [PATCH] open-plc-utils: fix musl and fortify source compatibility - Include `poll.h` at the top of `ether/readpacket.c` to avoid nested declaration errors caused by fortify source headers - Add missing `sys/select.h` include to `serial/serial.c` Signed-off-by: Jo-Philipp Wich --- ether/readpacket.c | 6 ++++-- serial/serial.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ether/readpacket.c b/ether/readpacket.c index e5bb8ec6..426b6865 100644 --- a/ether/readpacket.c +++ b/ether/readpacket.c @@ -70,6 +70,10 @@ #include #include +#if defined (__linux__) +#include +#endif + #include "../ether/channel.h" #include "../tools/memory.h" #include "../tools/error.h" @@ -95,8 +99,6 @@ ssize_t readpacket (struct channel const * channel, void * memory, ssize_t exten #elif defined (__linux__) -#include - struct pollfd pollfd = { channel->fd, diff --git a/serial/serial.c b/serial/serial.c index 1465c41f..26f64131 100644 --- a/serial/serial.c +++ b/serial/serial.c @@ -69,6 +69,8 @@ #if defined (WIN32) #include +#else +#include #endif /*====================================================================*