diff mbox series

[oe,meta-networking,8/9] relayd: Fix build with hardening flags and glibc

Message ID 20170617172142.1311-8-raj.khem@gmail.com
State Accepted
Commit 487481d48f8fd6c9cce77711e92d3bc9786a8fe1
Headers show
Series [oe,meta-filesystems,1/9] xfsprogs: Remove .la files in ${libdir} | expand

Commit Message

Khem Raj June 17, 2017, 5:21 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../0001-rtnl_flush-Error-on-failed-write.patch    | 34 ++++++++++++++++++++++
 .../recipes-connectivity/relayd/relayd_git.bb      |  4 ++-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch

-- 
2.13.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch b/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch
new file mode 100644
index 000000000..eaaf30460
--- /dev/null
+++ b/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch
@@ -0,0 +1,34 @@ 
+From 2fa326b26dc479942367dc4283e2f87372403988 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 09:32:04 -0700
+Subject: [PATCH] rtnl_flush: Error on failed write()
+
+Fixes
+route.c:45:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
+|   write(fd, "-1", 2);
+|   ^~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ route.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/route.c b/route.c
+index c552d1f..fc5c31e 100644
+--- a/route.c
++++ b/route.c
+@@ -42,7 +42,8 @@ static void rtnl_flush(void)
+ 	if (fd < 0)
+ 		return;
+ 
+-	write(fd, "-1", 2);
++	if (write(fd, "-1", 2) < 0 )
++		perror("write");
+ 	close(fd);
+ }
+ 
+-- 
+2.13.1
+
diff --git a/meta-networking/recipes-connectivity/relayd/relayd_git.bb b/meta-networking/recipes-connectivity/relayd/relayd_git.bb
index ef28d2c42..98dc41a09 100644
--- a/meta-networking/recipes-connectivity/relayd/relayd_git.bb
+++ b/meta-networking/recipes-connectivity/relayd/relayd_git.bb
@@ -5,7 +5,9 @@  LIC_FILES_CHKSUM = "file://main.c;endline=17;md5=86aad799085683e0a2e1c2684a20bab
 
 DEPENDS = "libubox"
 
-SRC_URI = "git://git.openwrt.org/project/relayd.git"
+SRC_URI = "git://git.openwrt.org/project/relayd.git \
+           file://0001-rtnl_flush-Error-on-failed-write.patch \
+"
 
 SRCREV = "ad0b25ad74345d367c62311e14b279f5ccb8ef13"
 PV = "0.0.1+git${SRCPV}"