When a daemon is set to monitor then saved_daemonize_id
needs to be closed in both the monitor and daemon processes
to avoid a leaking a file descriptor. This patch adds the latter.

---

v2:
        Use { } in if block
---
 lib/daemon.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/daemon.c b/lib/daemon.c
index ef1a24e..7c7de21 100644
--- a/lib/daemon.c
+++ b/lib/daemon.c
@@ -443,6 +443,9 @@ daemonize_start(void)
             monitor_daemon(daemon_pid);
         }
         /* Running in daemon process. */
+       if (saved_daemonize_fd != -1) {
+           close(saved_daemonize_fd);
+       }
     }
 
     if (pidfile) {
-- 
1.7.5.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to