mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
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 <jow@openwrt.org>
This commit is contained in:
33
utils/open-plc-utils/patches/100-musl-compat.patch
Normal file
33
utils/open-plc-utils/patches/100-musl-compat.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
--- a/ether/readpacket.c
|
||||
+++ b/ether/readpacket.c
|
||||
@@ -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"
|
||||
@@ -95,8 +99,6 @@ ssize_t readpacket (struct channel const
|
||||
|
||||
#elif defined (__linux__)
|
||||
|
||||
-#include <sys/poll.h>
|
||||
-
|
||||
struct pollfd pollfd =
|
||||
{
|
||||
channel->fd,
|
||||
--- a/serial/serial.c
|
||||
+++ b/serial/serial.c
|
||||
@@ -69,6 +69,8 @@
|
||||
|
||||
#if defined (WIN32)
|
||||
#include <Windows.h>
|
||||
+#else
|
||||
+#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
/*====================================================================*
|
||||
Reference in New Issue
Block a user