Replace my patch-aa with patch-aa and patch-ab received from the author.

This commit is contained in:
martti 2007-11-21 07:50:14 +00:00
parent 047b26e127
commit 15baf22906
3 changed files with 57 additions and 20 deletions

View file

@ -1,9 +1,10 @@
$NetBSD: distinfo,v 1.23 2007/11/20 11:57:59 martti Exp $
$NetBSD: distinfo,v 1.24 2007/11/21 07:50:14 martti Exp $
SHA1 (rrdtool-1.2.26.tar.gz) = 1896f8060b6ff15d16c3ca4a6d21ea59b202d999
RMD160 (rrdtool-1.2.26.tar.gz) = bd54677c70ec64cbdb2865109f4338243c160f82
Size (rrdtool-1.2.26.tar.gz) = 1080151 bytes
SHA1 (patch-aa) = 63638c3f204b216503eaa9832e38eb2873a5714c
SHA1 (patch-aa) = 95149f9f2a4e016fe79cb2845b7d796d6917f749
SHA1 (patch-ab) = 696b67b38c9da903606ad77dd8dd5e7ff9eb3b5b
SHA1 (patch-al) = f4e8687e8d92347373646c0db344911420203f84
SHA1 (patch-ap) = bfeb02ca36eae3858bbca31c2c369eb35bae7ef6
SHA1 (patch-as) = aa48dbc38ae23493b8ff700fabf90d6e0f3f1d5a

View file

@ -1,21 +1,19 @@
$NetBSD: patch-aa,v 1.8 2007/11/20 11:58:00 martti Exp $
$NetBSD: patch-aa,v 1.9 2007/11/21 07:50:14 martti Exp $
--- src/rrd_tool.h.orig 2007-11-20 02:15:10.000000000 +0200
+++ src/rrd_tool.h 2007-11-20 13:47:45.000000000 +0200
@@ -202,6 +202,16 @@
#endif
+#if defined(__NetBSD__)
+# if !defined(_NETBSD_SOURCE)
+# define _NETBSD_SOURCE
+# endif
+
+# if !defined(POSIX_MADV_RANDOM)
+# define POSIX_MADV_RANDOM MADV_RANDOM
+# endif
+#endif
+
#ifdef __cplusplus
Index: src/rrd_update.c
===================================================================
--- src/rrd_update.c (revision 1235)
+++ src/rrd_update.c (working copy)
@@ -427,10 +427,10 @@
fclose(rrd_file);
return(-1);
}
-#ifdef HAVE_MADVISE
+#ifdef USE_MADVISE
/* when we use mmaping we tell the kernel the mmap equivalent
of POSIX_FADV_RANDOM */
- madvise(rrd_mmaped_file,rrd_filesize,POSIX_MADV_RANDOM);
+ madvise(rrd_mmaped_file,rrd_filesize,MADV_RANDOM);
#endif
#endif
/* loop through the arguments. */

View file

@ -0,0 +1,38 @@
$NetBSD: patch-ab,v 1.7 2007/11/21 07:50:14 martti Exp $
--- configure.ac (revision 1235)
+++ configure.ac (working copy)
@@ -49,6 +49,13 @@
/* realloc does not support NULL as argument */
#undef NO_NULL_REALLOC
+/* lets enable madvise defines in netbsd */
+#if defined(__NetBSD__)
+# if !defined(_NETBSD_SOURCE)
+# define _NETBSD_SOURCE
+# endif
+#endif
+
])
AH_BOTTOM([
@@ -58,6 +65,19 @@
#include <fcntl.h>
#endif
+#if !defined HAVE_MADVISE && defined HAVE_POSIX_MADVISE
+/* use posix_madvise family */
+# define madvise posix_madvise
+# define MADV_NORMAL POSIX_MADV_NORMAL
+# define MADV_RANDOM POSIX_MADV_RANDOM
+# define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL
+# define MADV_WILLNEED POSIX_MADV_WILLNEED
+# define MADV_DONTNEED POSIX_MADV_DONTNEED
+#endif
+#if defined HAVE_MADVISE || defined HAVE_POSIX_MADVISE
+# define USE_MADVISE 1
+#endif
+
/* define strrchr, strchr and memcpy, memmove in terms of bsd funcs
make sure you are NOT using bcopy, index or rindex in the code */