瀏覽代碼

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>
Jo-Philipp Wich 9 年之前
父節點
當前提交
d3c279d4f6
共有 2 個文件被更改,包括 35 次插入2 次删除
  1. 2
    2
      utils/open-plc-utils/Makefile
  2. 33
    0
      utils/open-plc-utils/patches/100-musl-compat.patch

+ 2
- 2
utils/open-plc-utils/Makefile 查看文件

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2013-2014 OpenWrt.org
2
+# Copyright (C) 2013-2015 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=open-plc-utils
11
-PKG_VERSION:=2015-02-23
11
+PKG_VERSION:=2015-06-26
12 12
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13 13
 
14 14
 PKG_SOURCE_PROTO:=git

+ 33
- 0
utils/open-plc-utils/patches/100-musl-compat.patch 查看文件

@@ -0,0 +1,33 @@
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
+ /*====================================================================*