pkgsrc/news/nn/patches/patch-ak
2006-10-14 19:33:45 +00:00

88 lines
2.6 KiB
Text

$NetBSD: patch-ak,v 1.4 2006/10/14 19:33:45 schwarz Exp $
--- db.c.orig 2005-04-03 06:29:15.000000000 +0200
+++ db.c 2006-10-14 20:13:27.000000000 +0200
@@ -1139,7 +1139,7 @@
if (!db_sequential)
fseek(master_file,
- (off_t) (MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE +
+ (long) (MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE +
GROUP_FIELDS * sizeof(net_long) * gh->group_num), 0);
if (fread((char *) buf, sizeof(net_long), GROUP_FIELDS, master_file) != GROUP_FIELDS)
@@ -1181,7 +1181,7 @@
if (!db_sequential)
fseek(master_file,
- (off_t) (MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE +
+ (long) (MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE +
GROUP_FIELDS * sizeof(net_long) * gh->group_num), 0);
buf[0] = gh->first_db_article;
@@ -1386,10 +1386,10 @@
#ifndef NOV
-off_t
+long
db_read_art(FILE * f)
{
- off_t bytes;
+ long bytes;
#ifdef NETWORK_DATABASE
net_long buf[ARTICLE_FIELDS];
@@ -1594,7 +1594,7 @@
* fill in db_hdr and db_data from the overview data for the next
* article in this group. does weirdo nn encodings of header fields.
*/
-off_t
+long
db_read_art(FILE * f)
{
register data_header *dhp = &db_hdr;
@@ -1820,9 +1820,9 @@
{
#ifdef NETWORK_DATABASE
- return (off_t) ((art_num - gh->first_db_article) * sizeof(net_long));
+ return (long) ((art_num - gh->first_db_article) * sizeof(net_long));
#else /* NETWORK_DATABASE */
- return (off_t) ((art_num - gh->first_db_article) * sizeof(off_t));
+ return (long) ((art_num - gh->first_db_article) * sizeof(long));
#endif /* NETWORK_DATABASE */
}
@@ -1833,11 +1833,11 @@
long data_offset;
if (gh->first_db_article == art_num)
- return (off_t) 0;
+ return (long) 0;
index = open_data_file(gh, 'x', OPEN_READ);
if (index == NULL)
- return (off_t) (-1);
+ return (long) (-1);
fseek(index, get_index_offset(gh, art_num), 0);
if (!db_read_offset(index, &data_offset))
@@ -1866,7 +1866,7 @@
*offset = temp;
#else /* NETWORK_DATABASE */
- if (fread((char *) offset, sizeof(off_t), 1, f) != 1)
+ if (fread((char *) offset, sizeof(long), 1, f) != 1)
return 0;
#endif /* NETWORK_DATABASE */
@@ -1891,7 +1891,7 @@
#else /* NETWORK_DATABASE */
- if (fwrite((char *) offset, sizeof(off_t), 1, f) != 1)
+ if (fwrite((char *) offset, sizeof(long), 1, f) != 1)
return 0;
#endif /* NETWORK_DATABASE */