xref: /OK3568_Linux_fs/buildroot/package/collectd/0001-src-netlink.c-remove-REG_NOERROR.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom 5e600ae2ad370ddbb759e84ce55a7dfaa9a0bdd7 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3*4882a593SmuzhiyunDate: Sun, 6 Sep 2020 14:17:23 +0200
4*4882a593SmuzhiyunSubject: [PATCH] src/netlink.c: remove REG_NOERROR
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunREG_NOERROR is used since version 5.12.0 and
7*4882a593Smuzhiyunhttps://github.com/collectd/collectd/commit/f7fd32e5209e188db7985a42054252fc4cbfe7c1
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunHowever, REG_NOERROR is not defined by musl, even GNU regex do not
10*4882a593Smuzhiyunmention REG_NOERROR, so just remove it to avoid the following build
11*4882a593Smuzhiyunfailure:
12*4882a593Smuzhiyun
13*4882a593Smuzhiyunsrc/netlink.c: In function 'check_ignorelist':
14*4882a593Smuzhiyunsrc/netlink.c:243:51: error: 'REG_NOERROR' undeclared (first use in this function); did you mean 'REG_NOTBOL'?
15*4882a593Smuzhiyun       if (regexec(i->rdevice, dev, 0, NULL, 0) != REG_NOERROR)
16*4882a593Smuzhiyun                                                   ^~~~~~~~~~~
17*4882a593Smuzhiyun                                                   REG_NOTBOL
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunFixes:
20*4882a593Smuzhiyun - http://autobuild.buildroot.org/results/cd4d75888b5259b028132dd224be34f69bcbb702
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
23*4882a593Smuzhiyun[Upstream status: https://github.com/collectd/collectd/pull/3569]
24*4882a593Smuzhiyun---
25*4882a593Smuzhiyun src/netlink.c | 2 +-
26*4882a593Smuzhiyun 1 file changed, 1 insertion(+), 1 deletion(-)
27*4882a593Smuzhiyun
28*4882a593Smuzhiyundiff --git a/src/netlink.c b/src/netlink.c
29*4882a593Smuzhiyunindex 7a5da762..fac2fb1e 100644
30*4882a593Smuzhiyun--- a/src/netlink.c
31*4882a593Smuzhiyun+++ b/src/netlink.c
32*4882a593Smuzhiyun@@ -240,7 +240,7 @@ static int check_ignorelist(const char *dev, const char *type,
33*4882a593Smuzhiyun   for (ir_ignorelist_t *i = ir_ignorelist_head; i != NULL; i = i->next) {
34*4882a593Smuzhiyun #if HAVE_REGEX_H
35*4882a593Smuzhiyun     if (i->rdevice != NULL) {
36*4882a593Smuzhiyun-      if (regexec(i->rdevice, dev, 0, NULL, 0) != REG_NOERROR)
37*4882a593Smuzhiyun+      if (regexec(i->rdevice, dev, 0, NULL, 0))
38*4882a593Smuzhiyun         continue;
39*4882a593Smuzhiyun     } else
40*4882a593Smuzhiyun #endif
41*4882a593Smuzhiyun--
42*4882a593Smuzhiyun2.28.0
43*4882a593Smuzhiyun
44