- (djm) Merge cygwin support from Corinna Vinschen <vinschen@cygnus.com>
diff --git a/bsd-daemon.c b/bsd-daemon.c
index de82995..f704a90 100644
--- a/bsd-daemon.c
+++ b/bsd-daemon.c
@@ -51,6 +51,13 @@
 	case 0:
 		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);
 	}