summaryrefslogtreecommitdiff
path: root/news/nn/patches/patch-ak
blob: 97a047917d3127aaadd238fd839d1738f4e77d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
$NetBSD: patch-ak,v 1.2 1999/08/22 22:55:46 kim Exp $

--- db.c.orig	Tue Jun  8 00:19:45 1999
+++ db.c	Sun Aug 22 18:04:14 1999
@@ -1095,7 +1095,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)
@@ -1115,7 +1115,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;
@@ -1137,7 +1137,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;
@@ -1155,7 +1155,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)
@@ -1340,10 +1340,10 @@
 
 
 #ifndef NOV
-off_t db_read_art(f)
+long db_read_art(f)
 FILE *f;
 {
-    off_t bytes;
+    long bytes;
 
 #ifdef NETWORK_DATABASE
     net_long buf[ARTICLE_FIELDS];
@@ -1526,7 +1526,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;
 {
@@ -1734,32 +1734,32 @@
 }
 
 
-off_t get_index_offset(gh, art_num)
+long get_index_offset(gh, art_num)
 group_header *gh;
 article_number art_num;
 {
 #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 */
 }
 
-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;
 
-    if (gh->first_db_article == art_num) return (off_t)0;
+    if (gh->first_db_article == art_num) return (long)0;
 
     index = open_data_file(gh, 'x', OPEN_READ);
-    if (index == NULL) return (off_t)(-1);
+    if (index == NULL) 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);
 
@@ -1770,7 +1770,7 @@
 int
 db_read_offset(f, offset)
 FILE *f;
-off_t *offset;
+long *offset;
 {
 #ifdef NETWORK_DATABASE
     net_long temp;
@@ -1783,7 +1783,7 @@
     *offset = temp;
 #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;
 }
@@ -1791,7 +1791,7 @@
 int
 db_write_offset(f, offset)
 FILE *f;
-off_t *offset;
+long *offset;
 {
 #ifdef NETWORK_DATABASE
     net_long temp;
@@ -1805,7 +1805,7 @@
 
 #else	/* NETWORK_DATABASE */
 
-    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;
 }
@@ -1829,7 +1829,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;
@@ -1853,7 +1853,7 @@
   return NULL;
 }
 
-off_t
+long
 get_index_offset(gh, art_num)
 group_header *gh;
 article_number art_num;