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
|
$NetBSD: patch-ab,v 1.3 2005/04/01 03:28:36 kim Exp $
--- nntpclnt.c.orig 1994-08-11 17:37:51.000000000 -0400
+++ nntpclnt.c 2005-03-31 22:25:28.000000000 -0500
@@ -24,6 +24,11 @@
* Include configuration parameters only if we're made in the nntp tree.
*/
+#if defined(USG) || defined(MSDOS)
+#include <string.h>
+#else
+#include <strings.h>
+#endif
#ifdef NNTPSRC
#include "config.h"
#endif /* NNTPSRC */
@@ -64,11 +69,6 @@
#define net_read(a,b,c,d,e) soread(a,b,c)
#define net_write(a,b,c,d) sowrite(a,b,c)
#endif
-#if defined(USG) || defined(MSDOS)
-#include <string.h>
-#else
-#include <strings.h>
-#endif
#include "nntpclnt.h"
#ifdef NONETDB
# define IPPORT_NNTP ((unsigned short) 119)
@@ -199,7 +199,7 @@
server_init(machine)
char *machine;
{
- int sockt_rd, sockt_wr;
+ int sockt_rd, sockt_wr, result[2];
char line[256];
char *index();
#if defined(DECNET) || defined(SGI4DDN)
@@ -248,7 +248,13 @@
/* Now get the server's signon message */
(void) get_server(line, sizeof(line));
- return (atoi(line));
+ result[0] = atoi(line);
+
+ put_server("MODE READER");
+ (void) get_server(line, sizeof(line));
+ result[1] = atoi(line);
+
+ return ((result[1] != ERR_COMMAND) ? result[1] : result[0]);
}
#ifdef DATAKIT
|