Is newnews working on INN 2.3.0 ?

Katsuhiro Kondou kondou at nec.co.jp
Wed Jun 28 07:11:46 UTC 2000


In article <200006280635.IAA04737 at erik.net.uni-c.dk>,
	Erik Mouritzen <unilerik at erik.net.uni-c.dk> wrote;

} "news.notice" has this if newnews founds an empty newsgroup:
} 
} Jun 28 08:14:26 holein1 nnrpd[14476]: tradindexed: could not mmap data file
}   for alt.bigfoot: Invalid argument

This may happen for some Unix boxes if overview file is empty
but exists.  For those boxes mmap() will fail.  I've just wrote
the patch for it.  Can you examine attached?
-- 
Katsuhiro Kondou

--- storage/ov3/ov3.c.orig	Mon May 22 06:12:10 2000
+++ storage/ov3/ov3.c	Wed Jun 28 16:05:10 2000
@@ -468,6 +468,11 @@
 	return FALSE;
     }
     gh->indexlen = sb.st_size;
+    if (gh->datalen == NULL || gh->indexlen == NULL) {
+	gh->datamem = (char *)-1;
+	gh->indexmem = (INDEXENTRY *)-1;
+	return TRUE;
+    }
     if (!gh->datamem) {
 	if ((gh->datamem = (char *)mmap(0, gh->datalen, PROT_READ, MAP_SHARED,
 					gh->datafd, 0)) == (char *)-1) {
@@ -829,6 +834,8 @@
     OV3SEARCH           *search = (OV3SEARCH *)handle;
     INDEXENTRY           *ie;
 
+    if (search->gh->datamem == (char *)-1 || search->gh->indexmem == (INDEXENTRY *)-1)
+	return FALSE;
     for (ie = search->gh->indexmem;
 	 ((char *)&ie[search->cur] < (char *)search->gh->indexmem + search->gh->indexlen) &&
 	     (search->cur <= search->limit) &&



More information about the inn-workers mailing list