PATCH: fix MAP_FAILED and __attribute__ parse error issues

Matthias Andree matthias.andree at gmx.de
Mon Jan 19 05:02:02 CET 2004


As authenticated CVS is currently down on SourceForge for scheduled
maintenance; these patches should fix Henri van Riel's problems.

I'll commit them when CVS is back up.

The Makefile.am patch is unrelated and fixes a "mv asks questions" bug.
It can safely be omitted and should be if your automake is older than a
recent 1.7.X version.

__attribute__ #ifdef cleanups in the individual .c files are for later.

Untested, please report your findings with the patch.

Index: contrib/bogogrep.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/contrib/bogogrep.c,v
retrieving revision 1.3
diff -u -r1.3 bogogrep.c
--- contrib/bogogrep.c	17 Dec 2003 12:54:29 -0000	1.3
+++ contrib/bogogrep.c	19 Jan 2004 03:56:38 -0000
@@ -17,7 +17,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#ifdef __DGUX__
+#if defined(__DGUX__) || !defined(MAP_FAILED)
 #define MAP_FAILED (-1)
 #endif
 
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/Makefile.am,v
retrieving revision 1.75
diff -u -r1.75 Makefile.am
--- src/Makefile.am	5 Jan 2004 17:09:44 -0000	1.75
+++ src/Makefile.am	19 Jan 2004 03:56:38 -0000
@@ -190,8 +190,8 @@
 	$(bogolexer_SOURCES)				\
 	$(bogoutil_SOURCES)				\
 	$(bogotune_SOURCES)
-	$(SHELL) $(srcdir)/version.sh $(top_srcdir) >"$@.new" && mv "$@.new" "$@" \
-	    || rm -f "$@"
+	$(SHELL) $(srcdir)/version.sh $(top_srcdir) >"$@.new" && mv -f "$@.new" "$@" \
+	    || { rm -f "$@" ; false ; }
 #
 directories.c: ../config.status
 	echo "const char *const system_config_file = \"$(SYSCONFDIR)/bogofilter.cf\";" >"$@" \
Index: src/system.h
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/system.h,v
retrieving revision 1.21
diff -u -r1.21 system.h
--- src/system.h	9 Dec 2003 00:07:50 -0000	1.21
+++ src/system.h	19 Jan 2004 03:56:39 -0000
@@ -205,6 +205,11 @@
 #undef EX_OK
 #endif
 
+/* Ignore __attribute__ if not using GNU CC */
+#ifndef __GNUC__
+#define __attribute__(a)
+#endif
+
 /* system.c - function prototypes */
 
 extern bool bf_abspath(const char *path);

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95




More information about the Bogofilter mailing list