diff options
| -rw-r--r-- | meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch | 50 | ||||
| -rw-r--r-- | meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb | 1 |
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 0000000000..c2757a2fb7 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From ba71f768e6dbb1f2ac72ed3bd880bff75a48d345 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Roy Li <rongqing.li@windriver.com> | ||
| 3 | Date: Wed, 19 Feb 2014 14:13:40 +0800 | ||
| 4 | Subject: [PATCH] babeld: close stdout once the background daemon is created | ||
| 5 | |||
| 6 | Upstream-Status: pending | ||
| 7 | |||
| 8 | Once babald becomes a background daemon, it should not output information to | ||
| 9 | stdout, so need to close stdout. | ||
| 10 | |||
| 11 | In fact, other daemons close their stdout when they run into background, like | ||
| 12 | ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c | ||
| 13 | |||
| 14 | Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp } | ||
| 15 | |||
| 16 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
| 17 | --- | ||
| 18 | babeld/util.c | 10 +++++++++- | ||
| 19 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/babeld/util.c b/babeld/util.c | ||
| 22 | index 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 | -- | ||
| 49 | 1.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 ae93952e3e..db2a67b4a9 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" | |||
| 5 | SRC_URI += "file://0001-doc-fix-makeinfo-errors-and-one-warning.patch \ | 5 | SRC_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 | ||
| 10 | SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f" | 11 | SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f" |
