>From 6aba263066ede4721aab1fa9bf9415c51a3195a1 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 9 Dec 2009 14:29:49 +0000 Subject: [PATCH] chdir ("/") when daemonizing self. --- vhostmd/vhostmd.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/vhostmd/vhostmd.c b/vhostmd/vhostmd.c index 034dc26..77d196e 100644 --- a/vhostmd/vhostmd.c +++ b/vhostmd/vhostmd.c @@ -183,6 +183,9 @@ static int daemonize(void) if (close(stdoutfd) < 0) goto cleanup; stdoutfd = -1; + + if (chdir ("/") == -1) + goto cleanup; if (setsid() < 0) goto cleanup; -- 1.6.5.2