From 1197bbe493cce7ea48139db8e4568c87576b4eaf Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Tue, 26 May 2009 17:45:19 +0200 Subject: [PATCH] Actually go daemon just doing chdir("/") leave file descriptors open, which is not ideal. Doing it this way closes everything, including any system-specific things we're not aware of. --- nbd-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd-client.c b/nbd-client.c index 13f0dde..913af90 100644 --- a/nbd-client.c +++ b/nbd-client.c @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) { /* Go daemon */ - chdir("/"); + daemon(0,0); do { #ifndef NOFORK if (!nofork) { -- 1.7.10.4