open-plc-utils: fix musl and fortify source compatibility
[feed/packages.git] / utils / open-plc-utils / patches / 100-musl-compat.patch
1 --- a/ether/readpacket.c
2 +++ b/ether/readpacket.c
3 @@ -70,6 +70,10 @@
4 #include <memory.h>
5 #include <errno.h>
6
7 +#if defined (__linux__)
8 +#include <poll.h>
9 +#endif
10 +
11 #include "../ether/channel.h"
12 #include "../tools/memory.h"
13 #include "../tools/error.h"
14 @@ -95,8 +99,6 @@ ssize_t readpacket (struct channel const
15
16 #elif defined (__linux__)
17
18 -#include <sys/poll.h>
19 -
20 struct pollfd pollfd =
21 {
22 channel->fd,
23 --- a/serial/serial.c
24 +++ b/serial/serial.c
25 @@ -69,6 +69,8 @@
26
27 #if defined (WIN32)
28 #include <Windows.h>
29 +#else
30 +#include <sys/select.h>
31 #endif
32
33 /*====================================================================*