From: Adam Dickmeiss Date: Thu, 21 Feb 2008 10:15:30 +0000 (+0000) Subject: Added yaz_daemoon for windows. X-Git-Tag: YAZ.3.0.26~4 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=2dbe1df5facb92bac31b5da0ca2e2e8ee6f9b358;p=yaz-moved-to-github.git Added yaz_daemoon for windows. --- diff --git a/src/daemon.c b/src/daemon.c index a3a6ab1..f9d663a 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2008, Index Data ApS * See the file LICENSE for details. * - * $Id: daemon.c,v 1.1 2008-02-18 17:07:06 adam Exp $ + * $Id: daemon.c,v 1.2 2008-02-21 10:15:30 adam Exp $ */ /** @@ -17,20 +17,32 @@ #include #include #include +#if HAVE_UNISTD_H #include -#include +#endif #include #include +#if HAVE_SYS_WAIT_H #include +#endif + #include + +#if HAVE_SYS_STAT_H #include +#endif + #include + +#if HAVE_PWD_H #include +#endif #include #include #include +#if HAVE_PWD_H static void write_pidfile(int pid_fd) { if (pid_fd != -1) @@ -148,12 +160,14 @@ static void keepalive(void (*work)(void *data), void *data) run++; } } +#endif int yaz_daemon(const char *progname, unsigned int flags, void (*work)(void *data), void *data, const char *pidfile, const char *uid) { +#if HAVE_PWD_H int pid_fd = -1; /* open pidfile .. defer write until in child and after setuid */ @@ -249,6 +263,10 @@ int yaz_daemon(const char *progname, work(data); } return 0; +#else + work(data); + return 0; +#endif } /* diff --git a/win/makefile b/win/makefile index 31527f9..97136b0 100644 --- a/win/makefile +++ b/win/makefile @@ -1,6 +1,6 @@ # Copyright (C) 1995-2008, Index Data ApS # All rights reserved. -# $Id: makefile,v 1.144 2008-01-18 11:47:56 adam Exp $ +# $Id: makefile,v 1.145 2008-02-21 10:15:31 adam Exp $ # # Programmed by # Heikki Levanto & Adam Dickmeiss @@ -479,6 +479,7 @@ MISC_OBJS= \ $(OBJDIR)\http.obj \ $(OBJDIR)\match_glob.obj \ $(OBJDIR)\poll.obj \ + $(OBJDIR)\daemon.obj Z3950_OBJS= \ $(OBJDIR)\z-date.obj\