From cbc11436c4349e582f1bbdafa0446d232de24e22 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 18 Feb 2015 14:48:04 +0100 Subject: llmnrd: Support daemonization No logging to syslog or dropping of privileges etc yet. Signed-off-by: Tobias Klauser --- llmnrd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llmnrd.c b/llmnrd.c index ff70ff8..442a600 100644 --- a/llmnrd.c +++ b/llmnrd.c @@ -18,6 +18,7 @@ * along with llmnrd. If not, see . */ +#include #include #include #include @@ -149,7 +150,10 @@ int main(int argc, char **argv) } if (daemonize) { - /* TODO */ + if (daemon(0, 0) != 0) { + log_err("Failed to daemonize process: %s\n", strerror(errno)); + return EXIT_FAILURE; + } } if (iface_start_thread() < 0) -- cgit v1.2.3-54-g00ecf