dad23f5f5da3dfc19e29a407049a222811a7f192
[feed/routing.git] / ndppd / patches / 0001-Fix-issue-2-ndppd-d-monizes-too-early.patch
1 From 00da8bf7bab88a3827af4110fb27df9cde542e32 Mon Sep 17 00:00:00 2001
2 From: Daniel Adolfsson <daniel@priv.nu>
3 Date: Tue, 12 Feb 2013 13:25:22 +0100
4 Subject: [PATCH] =?UTF-8?q?Fix=20issue=20#2=20-=20ndppd=20d=C3=A6monizes=20t?=
5 =?UTF-8?q?oo=20early?=
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 ---
11 src/ndppd.cc | 18 ++++++++----------
12 1 file changed, 8 insertions(+), 10 deletions(-)
13
14 diff --git a/src/ndppd.cc b/src/ndppd.cc
15 index 6ac19e8..20ced6f 100644
16 --- a/src/ndppd.cc
17 +++ b/src/ndppd.cc
18 @@ -201,15 +201,6 @@ int main(int argc, char* argv[], char* env[])
19 }
20 }
21
22 - if (daemon) {
23 - logger::syslog(true);
24 -
25 - if (daemonize() < 0) {
26 - logger::error() << "Failed to daemonize process";
27 - return 1;
28 - }
29 - }
30 -
31 if (!pidfile.empty()) {
32 std::ofstream pf;
33 pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
34 @@ -225,8 +216,15 @@ int main(int argc, char* argv[], char* env[])
35
36 if (!configure(config_path))
37 return -1;
38 +
39 + if (daemon) {
40 + logger::syslog(true);
41
42 - //route::load("/proc/net/ipv6_route");
43 + if (daemonize() < 0) {
44 + logger::error() << "Failed to daemonize process";
45 + return 1;
46 + }
47 + }
48
49 // Time stuff.
50
51 --
52 1.7.10.4
53