diff options
Diffstat (limited to 'news/nn/patches/patch-ak')
-rw-r--r-- | news/nn/patches/patch-ak | 171 |
1 files changed, 51 insertions, 120 deletions
diff --git a/news/nn/patches/patch-ak b/news/nn/patches/patch-ak index 0be866ec8e4..743f44be7ff 100644 --- a/news/nn/patches/patch-ak +++ b/news/nn/patches/patch-ak @@ -1,157 +1,88 @@ -$NetBSD: patch-ak,v 1.3 2002/07/08 02:21:20 kim Exp $ +$NetBSD: patch-ak,v 1.4 2006/10/14 19:33:45 schwarz Exp $ ---- db.c.orig Thu Jan 31 23:10:27 2002 -+++ db.c Sun Jul 7 21:33:09 2002 -@@ -1103,7 +1103,7 @@ +--- 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); +- (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) -@@ -1123,7 +1123,7 @@ - #else - if (!db_sequential) - fseek(master_file, -- (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); -+ (long)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); - - if (fread((char *)gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, master_file) != 1) - goto err; -@@ -1145,7 +1145,7 @@ + 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); +- (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; -@@ -1163,7 +1163,7 @@ - goto err; - #else /* NETWORK_DATABASE */ - if (!db_sequential) -- fseek(master_file, (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); -+ fseek(master_file, (long)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); - - - if (fwrite((char *)gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, master_file) != 1) -@@ -1348,10 +1348,10 @@ +@@ -1386,10 +1386,10 @@ #ifndef NOV --off_t db_read_art(f) -+long db_read_art(f) - FILE *f; +-off_t ++long + db_read_art(FILE * f) { -- off_t bytes; -+ long bytes; +- off_t bytes; ++ long bytes; #ifdef NETWORK_DATABASE - net_long buf[ARTICLE_FIELDS]; -@@ -1556,7 +1556,7 @@ + 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(f) - FILE *f; + db_read_art(FILE * f) { -@@ -1764,32 +1764,32 @@ - } - - --off_t get_index_offset(gh, art_num) -+long get_index_offset(gh, art_num) - group_header *gh; - article_number art_num; + 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 */ +- 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 */ } --off_t get_data_offset(gh, art_num) -+long get_data_offset(gh, art_num) - group_header *gh; - article_number art_num; - { - FILE *index; -- off_t data_offset; -+ long data_offset; +@@ -1833,11 +1833,11 @@ + long data_offset; -- if (gh->first_db_article == art_num) return (off_t)0; -+ if (gh->first_db_article == art_num) return (long)0; + 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); -+ if (index == NULL) return (long)(-1); + 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)) -- data_offset = (off_t)(-1); -+ data_offset = (long)(-1); - - fclose(index); - -@@ -1800,7 +1800,7 @@ - int - db_read_offset(f, offset) - FILE *f; --off_t *offset; -+long *offset; - { - #ifdef NETWORK_DATABASE - net_long temp; -@@ -1813,7 +1813,7 @@ +@@ -1866,7 +1866,7 @@ *offset = temp; - #else /* NETWORK_DATABASE */ + #else /* NETWORK_DATABASE */ -- if (fread((char *)offset, sizeof(off_t), 1, f) != 1) return 0; -+ if (fread((char *)offset, sizeof(long), 1, f) != 1) return 0; - #endif /* NETWORK_DATABASE */ - return 1; - } -@@ -1821,7 +1821,7 @@ - int - db_write_offset(f, offset) - FILE *f; --off_t *offset; -+long *offset; - { - #ifdef NETWORK_DATABASE - net_long temp; -@@ -1835,7 +1835,7 @@ +- if (fread((char *) offset, sizeof(off_t), 1, f) != 1) ++ if (fread((char *) offset, sizeof(long), 1, f) != 1) + return 0; + #endif /* NETWORK_DATABASE */ - #else /* NETWORK_DATABASE */ +@@ -1891,7 +1891,7 @@ -- if (fwrite((char *)offset, sizeof(off_t), 1, f) != 1) return 0; -+ if (fwrite((char *)offset, sizeof(long), 1, f) != 1) return 0; - #endif /* NETWORK_DATABASE */ - return 1; - } -@@ -1859,7 +1859,7 @@ - int - db_read_offset(f, offset) - FILE *f; --off_t *offset; -+long *offset; - { - nn_exitmsg(50, "STUB ROUTINE CALLED: db_read_offset\n"); - return -1; -@@ -1883,7 +1883,7 @@ - return NULL; - } + #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 */ --off_t -+long - get_index_offset(gh, art_num) - group_header *gh; - article_number art_num; |