summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/quagga
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2014-02-19 15:38:03 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-02-23 23:17:29 +0100
commit7a673eb37eb784b604f57884f802635aa2c1a49a (patch)
tree993f2429d6d2fafebf2f44442ffe6efe6701a192 /meta-networking/recipes-protocols/quagga
parentbc6e6112e6c7082241c69fb3d8277b267dd5620a (diff)
downloadmeta-openembedded-7a673eb37eb784b604f57884f802635aa2c1a49a.tar.gz
quagga: close the stdout/stderr as in other daemons
Once babald becomes a background daemon, it should not output information to stdout, so need to close stdout. In fact, other daemons close their stdout when they run into background, like ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp } Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-networking/recipes-protocols/quagga')
-rw-r--r--meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch50
-rw-r--r--meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb1
2 files changed, 51 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch
new file mode 100644
index 000000000..c2757a2fb
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch
@@ -0,0 +1,50 @@
1From ba71f768e6dbb1f2ac72ed3bd880bff75a48d345 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Wed, 19 Feb 2014 14:13:40 +0800
4Subject: [PATCH] babeld: close stdout once the background daemon is created
5
6Upstream-Status: pending
7
8Once babald becomes a background daemon, it should not output information to
9stdout, so need to close stdout.
10
11In fact, other daemons close their stdout when they run into background, like
12ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c
13
14Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp }
15
16Signed-off-by: Roy Li <rongqing.li@windriver.com>
17---
18 babeld/util.c | 10 +++++++++-
19 1 file changed, 9 insertions(+), 1 deletion(-)
20
21diff --git a/babeld/util.c b/babeld/util.c
22index 011f382..76203bc 100644
23--- a/babeld/util.c
24+++ b/babeld/util.c
25@@ -425,7 +425,7 @@ uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src)
26 int
27 daemonise()
28 {
29- int rc;
30+ int rc, fd;
31
32 fflush(stdout);
33 fflush(stderr);
34@@ -441,5 +441,13 @@ daemonise()
35 if(rc < 0)
36 return -1;
37
38+ fd = open("/dev/null", O_RDWR, 0);
39+ if (fd != -1)
40+ {
41+ dup2(fd, STDOUT_FILENO);
42+ if (fd > 2)
43+ close(fd);
44+ }
45+
46 return 1;
47 }
48--
491.7.10.4
50
diff --git a/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb
index ae93952e3..db2a67b4a 100644
--- a/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb
+++ b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb
@@ -5,6 +5,7 @@ PR = "${INC_PR}.0"
5SRC_URI += "file://0001-doc-fix-makeinfo-errors-and-one-warning.patch \ 5SRC_URI += "file://0001-doc-fix-makeinfo-errors-and-one-warning.patch \
6 file://lingering-IP-address-after-deletion-BZ-486.patch \ 6 file://lingering-IP-address-after-deletion-BZ-486.patch \
7 file://build-fix-extract.pl-for-cross-compilation.patch \ 7 file://build-fix-extract.pl-for-cross-compilation.patch \
8 file://babel-close-the-stdout-stderr-as-in-other-daemons.patch \
8" 9"
9 10
10SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f" 11SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f"