| @@ -1,52 +1,77 @@ | | | @@ -1,52 +1,77 @@ |
1 | $NetBSD: patch-ab,v 1.3 2005/04/01 03:28:36 kim Exp $ | | 1 | $NetBSD: patch-ab,v 1.4 2010/12/15 03:14:51 chuck Exp $ |
2 | | | 2 | |
3 | --- nntpclnt.c.orig 1994-08-11 17:37:51.000000000 -0400 | | 3 | --- nntpclnt.c.orig 1994-08-11 17:37:51.000000000 -0400 |
4 | +++ nntpclnt.c 2005-03-31 22:25:28.000000000 -0500 | | 4 | +++ nntpclnt.c 2010-12-14 22:08:04.000000000 -0500 |
5 | @@ -24,6 +24,11 @@ | | 5 | @@ -24,6 +24,11 @@ |
6 | * Include configuration parameters only if we're made in the nntp tree. | | 6 | * Include configuration parameters only if we're made in the nntp tree. |
7 | */ | | 7 | */ |
8 | | | 8 | |
9 | +#if defined(USG) || defined(MSDOS) | | 9 | +#if defined(USG) || defined(MSDOS) |
10 | +#include <string.h> | | 10 | +#include <string.h> |
11 | +#else | | 11 | +#else |
12 | +#include <strings.h> | | 12 | +#include <strings.h> |
13 | +#endif | | 13 | +#endif |
14 | #ifdef NNTPSRC | | 14 | #ifdef NNTPSRC |
15 | #include "config.h" | | 15 | #include "config.h" |
16 | #endif /* NNTPSRC */ | | 16 | #endif /* NNTPSRC */ |
17 | @@ -64,11 +69,6 @@ | | 17 | @@ -64,11 +69,6 @@ |
18 | #define net_read(a,b,c,d,e) soread(a,b,c) | | 18 | #define net_read(a,b,c,d,e) soread(a,b,c) |
19 | #define net_write(a,b,c,d) sowrite(a,b,c) | | 19 | #define net_write(a,b,c,d) sowrite(a,b,c) |
20 | #endif | | 20 | #endif |
21 | -#if defined(USG) || defined(MSDOS) | | 21 | -#if defined(USG) || defined(MSDOS) |
22 | -#include <string.h> | | 22 | -#include <string.h> |
23 | -#else | | 23 | -#else |
24 | -#include <strings.h> | | 24 | -#include <strings.h> |
25 | -#endif | | 25 | -#endif |
26 | #include "nntpclnt.h" | | 26 | #include "nntpclnt.h" |
27 | #ifdef NONETDB | | 27 | #ifdef NONETDB |
28 | # define IPPORT_NNTP ((unsigned short) 119) | | 28 | # define IPPORT_NNTP ((unsigned short) 119) |
29 | @@ -199,7 +199,7 @@ | | 29 | @@ -154,7 +154,9 @@ |
| | | 30 | static char buf[256]; |
| | | 31 | char *index(); |
| | | 32 | char *getenv(); |
| | | 33 | +#ifndef strcpy |
| | | 34 | char *strcpy(); |
| | | 35 | +#endif |
| | | 36 | |
| | | 37 | if (cp = getenv("NNTPSERVER")) { |
| | | 38 | (void) strcpy(buf, cp); |
| | | 39 | @@ -199,7 +201,7 @@ |
30 | server_init(machine) | | 40 | server_init(machine) |
31 | char *machine; | | 41 | char *machine; |
32 | { | | 42 | { |
33 | - int sockt_rd, sockt_wr; | | 43 | - int sockt_rd, sockt_wr; |
34 | + int sockt_rd, sockt_wr, result[2]; | | 44 | + int sockt_rd, sockt_wr, result[2]; |
35 | char line[256]; | | 45 | char line[256]; |
36 | char *index(); | | 46 | char *index(); |
37 | #if defined(DECNET) || defined(SGI4DDN) | | 47 | #if defined(DECNET) || defined(SGI4DDN) |
38 | @@ -248,7 +248,13 @@ | | 48 | @@ -248,7 +250,13 @@ |
39 | /* Now get the server's signon message */ | | 49 | /* Now get the server's signon message */ |
40 | | | 50 | |
41 | (void) get_server(line, sizeof(line)); | | 51 | (void) get_server(line, sizeof(line)); |
42 | - return (atoi(line)); | | 52 | - return (atoi(line)); |
43 | + result[0] = atoi(line); | | 53 | + result[0] = atoi(line); |
44 | + | | 54 | + |
45 | + put_server("MODE READER"); | | 55 | + put_server("MODE READER"); |
46 | + (void) get_server(line, sizeof(line)); | | 56 | + (void) get_server(line, sizeof(line)); |
47 | + result[1] = atoi(line); | | 57 | + result[1] = atoi(line); |
48 | + | | 58 | + |
49 | + return ((result[1] != ERR_COMMAND) ? result[1] : result[0]); | | 59 | + return ((result[1] != ERR_COMMAND) ? result[1] : result[0]); |
50 | } | | 60 | } |
51 | | | 61 | |
52 | #ifdef DATAKIT | | 62 | #ifdef DATAKIT |
| | | 63 | @@ -296,6 +304,14 @@ |
| | | 64 | * |
| | | 65 | * Errors: Printed via perror. |
| | | 66 | */ |
| | | 67 | +#ifdef h_addr |
| | | 68 | +/* |
| | | 69 | + * would like to include <arpa/inet.h> for the inet_ntoa() prototype, |
| | | 70 | + * but we have our own version of inet_addr() that does not match |
| | | 71 | + * the prototype in <arpa/inet.h> |
| | | 72 | + */ |
| | | 73 | +extern char *inet_ntoa(struct in_addr in); |
| | | 74 | +#endif |
| | | 75 | |
| | | 76 | int |
| | | 77 | get_tcp_socket(machine) |