X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2Flog-dump.c;h=16e639ffa9e04ba230eea4ab475014daa4c7dc28;hb=494c52acf33fd637b82c489525a3528a8d9a9abc;hp=d2023ad87523e017a5cdc737fa2c38a4648250fb;hpb=0198fd3ca83ad0dbdb1c3bfb967d1843a7d02296;p=catagits%2Ffcgi2.git diff --git a/examples/log-dump.c b/examples/log-dump.c index d2023ad..16e639f 100644 --- a/examples/log-dump.c +++ b/examples/log-dump.c @@ -1,4 +1,4 @@ -/* +/* * log-dump.c -- * * FastCGI example program to illustrate both an Authorizer and a @@ -14,21 +14,30 @@ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * */ - #ifndef lint -static const char rcsid[] = "$Id: log-dump.c,v 1.1 1997/09/16 15:36:28 stanleyg Exp $"; +static const char rcsid[] = "$Id: log-dump.c,v 1.4 1999/07/28 00:30:10 roberts Exp $"; #endif /* not lint */ -#include "fcgi_stdio.h" +#include "fcgi_config.h" + +#include #include #include -#ifdef HAVE_STRINGS_H -#include -#endif +#include #include #include #include +#if defined __linux__ +int kill(pid_t pid, int sig); +#endif + +#if defined HAVE_UNISTD_H +#include +#endif + +#include "fcgi_stdio.h" + #ifndef NULL #define NULL 0 #endif @@ -36,7 +45,7 @@ static const char rcsid[] = "$Id: log-dump.c,v 1.1 1997/09/16 15:36:28 stanleyg static int successCount = 0; static int failureCount = 0; -void main(void) +int main(void) { char *queryString = NULL; char *rolePtr; @@ -45,7 +54,7 @@ void main(void) int fd, n, i, j; char temp[4096]; char temp2[5000]; - + while(FCGI_Accept() >= 0) { rolePtr = getenv("FCGI_ROLE"); if(rolePtr == NULL) { @@ -129,4 +138,6 @@ void main(void) continue; } } + + exit(0); }