Skip to content

Commit

Permalink
open-plc-utils: fix musl and fortify source compatibility
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
jow- authored and mhei committed Nov 2, 2015
1 parent 885a1b7 commit ce41b2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ether/readpacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
#include <memory.h>
#include <errno.h>

#if defined (__linux__)
#include <poll.h>
#endif

#include "../ether/channel.h"
#include "../tools/memory.h"
#include "../tools/error.h"
Expand All @@ -95,8 +99,6 @@ ssize_t readpacket (struct channel const * channel, void * memory, ssize_t exten

#elif defined (__linux__)

#include <sys/poll.h>

struct pollfd pollfd =
{
channel->fd,
Expand Down
2 changes: 2 additions & 0 deletions serial/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@

#if defined (WIN32)
#include <Windows.h>
#else
#include <sys/select.h>
#endif

/*====================================================================*
Expand Down

0 comments on commit ce41b2b

Please sign in to comment.