+Sun Apr 22 19:02:12 CDT 2001 Adam Heath <doogie@debian.org>
+
+ * lib/parse.c: s/PARSE_MMAP/HAVE_MMAP/, so that we now use mmap
+ to read status and available(and like files).
+
Sun Apr 22 18:32:02 CDT 2001 Adam Heath <doogie@debian.org>
* lib/parse.c: Fix another segfault when parsing single-paragraph
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
-#ifdef PARSE_MMAP
-#include <sys/mman.h>
-#endif
#include <config.h>
#include <dpkg.h>
#include <dpkg-db.h>
#include "parsedump.h"
+#ifdef HAVE_MMAP
+#include <sys/mman.h>
+#endif
+
const struct fieldinfo fieldinfos[]= {
/* NB: capitalisation of these strings is important. */
{ "Package", f_name, w_name },
if (fstat(fd, &stat) == -1)
ohshite(_("can't stat package info file `%.255s'"),filename);
-#ifdef PARSE_MMAP
+#ifdef HAVE_MMAP
if ((dataptr= (char *)mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED)
ohshite(_("can't mmap package info file `%.255s'"),filename);
#else
if (c == '\n') lno++;
}
pop_cleanup(0);
-#ifdef PARSE_MMAP
+#ifdef HAVE_MMAP
munmap(data, stat.st_size);
#else
free(data);