Update of /cvsroot/mahogany/M/lib/dspam/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14530/tools
Modified Files:
dspam_stats.c
Log Message:
win32 build fixes
Index: dspam_stats.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/tools/dspam_stats.c,v
retrieving revision 1.1.3.1
retrieving revision 1.2
diff -b -u -2 -r1.1.3.1 -r1.2
--- dspam_stats.c 7 Jul 2004 23:27:36 -0000 1.1.3.1
+++ dspam_stats.c 7 Jul 2004 23:43:00 -0000 1.2
@@ -27,5 +27,4 @@
#include <string.h>
#include <fcntl.h>
-#include <dirent.h>
#include <ctype.h>
#include <sys/types.h>
@@ -33,5 +32,8 @@
#include <errno.h>
#include <signal.h>
+#ifndef _WIN32
#include <unistd.h>
+#include <dirent.h>
+#endif
#include "config.h"
@@ -52,9 +54,14 @@
{
int ch,i;
+#ifndef HAVE_GETOPT
+ int optind = 1;
+#endif
open_ctx = open_mtx = NULL;
signal (SIGINT, dieout);
+#ifndef _WIN32
signal (SIGPIPE, dieout);
+#endif
signal (SIGTERM, dieout);
@@ -63,5 +70,12 @@
/* Process command line */
ch = opt_humanfriendly = 0;
+#ifdef HAVE_GETOPT
while((ch = getopt(argc, argv, "hH")) != -1)
+#else
+ while ( argv[optind] &&
+ argv[optind][0] == '-' &&
+ (ch = argv[optind][1]) &&
+ argv[optind][2] == '\0' )
+#endif
{
switch(ch) {
@@ -73,5 +87,15 @@
opt_humanfriendly = 1;
break;
+
+#ifndef HAVE_GETOPT
+ default:
+ fprintf(stderr, "%s: unknown option \"%s\".\n",
+ argv[0], argv[optind] + 1);
+ usage();
+#endif
}
+#ifndef HAVE_GETOPT
+ optind++;
+#endif
}
/* reset our option array and index to where we are after getopt */
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates