From 1ea89bd54442d4040d50aad91e1c86bfeeddc723 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 4 Sep 2006 02:23:19 +0000 Subject: remove all trailing whitespace, not just first occurrence. :) git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@329 b0b603af-a30f-0410-a34e-baf09ae79d0b --- daemon.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'daemon.c') diff --git a/daemon.c b/daemon.c index b80c53e..84cff4e 100644 --- a/daemon.c +++ b/daemon.c @@ -28,22 +28,18 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - #if defined __SUNPRO_C || defined __DECC || defined __HP_cc # pragma ident "@(#)$Header: /cvsroot/wikipedia/willow/src/bin/willow/daemon.c,v 1.1 2005/05/02 19:15:21 kateturner Exp $" # pragma ident "$NetBSD: daemon.c,v 1.9 2003/08/07 16:42:46 agc Exp $" #endif - #include #include #include - int daemon(nochdir, noclose) int nochdir, noclose; { int fd; - switch (fork()) { case -1: return (-1); @@ -52,13 +48,10 @@ daemon(nochdir, noclose) default: _exit(0); } - if (setsid() == -1) return (-1); - if (!nochdir) (void)chdir("/"); - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); @@ -67,4 +60,4 @@ daemon(nochdir, noclose) (void)close(fd); } return (0); -} +} \ No newline at end of file -- cgit v1.2.1