X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/d74671e4f6305b52358153545c32858b05a263e6..14a260e80d26f4ddd4ed6ba289183e95f5a16355:/openbsd-compat/daemon.c diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c index c0be5fff..3efe14c6 100644 --- a/openbsd-compat/daemon.c +++ b/openbsd-compat/daemon.c @@ -1,5 +1,4 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/daemon.c */ - +/* $OpenBSD: daemon.c,v 1.6 2005/08/08 08:05:33 espie Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -29,13 +28,25 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/daemon.c */ + #include "includes.h" #ifndef HAVE_DAEMON -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: daemon.c,v 1.5 2003/07/15 17:32:41 deraadt Exp $"; -#endif /* LIBC_SCCS and not lint */ +#include + +#ifdef HAVE_SYS_STAT_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif int daemon(int nochdir, int noclose) @@ -46,18 +57,8 @@ daemon(int nochdir, int noclose) case -1: return (-1); case 0: -#ifdef HAVE_CYGWIN - register_9x_service(); -#endif break; default: -#ifdef HAVE_CYGWIN - /* - * This sleep avoids a race condition which kills the - * child process if parent is started by a NT/W2K service. - */ - sleep(1); -#endif _exit(0); }