daemon: Close standard file descriptors after detach for windows.
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 23 Apr 2014 17:28:00 +0000 (10:28 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 24 Apr 2014 21:43:37 +0000 (14:43 -0700)
commitd6bc33f37a218832456fed11fa1796e6b7e93102
tree26a9824f307a8dccfbadce6a0b73c26349815a17
parenta91dc4447bb6c6bd8807aaaa4e00af0abe4fa5c7
daemon: Close standard file descriptors after detach for windows.

In the unit tests, we check for some logs stored in stderr. In case
of windows, unit tests fail because the child writes additional information
into stderr because it does not have it closed. This commit
closes standard file descriptors for windows too.

Because the functions related to closing file descriptors is common
for both windows and unix, add it to the common daemonization file
daemon.c

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/automake.mk
lib/daemon-unix.c
lib/daemon-windows.c
lib/daemon.c [new file with mode: 0644]
lib/daemon.h