Commit 528bfcd7 authored by Andrew Tridgell's avatar Andrew Tridgell

cosmetic fix. don't display a EOF error when displaying just the motd

from a rsync server
parent a1e13a93
...@@ -32,10 +32,11 @@ static int io_multiplexing_in; ...@@ -32,10 +32,11 @@ static int io_multiplexing_in;
static int multiplex_in_fd; static int multiplex_in_fd;
static int multiplex_out_fd; static int multiplex_out_fd;
static time_t last_io; static time_t last_io;
static int eof_error=1;
extern int verbose; extern int verbose;
extern int io_timeout; extern int io_timeout;
int64 write_total(void) int64 write_total(void)
{ {
return total_written; return total_written;
...@@ -119,7 +120,9 @@ static int read_timeout(int fd, char *buf, int len) ...@@ -119,7 +120,9 @@ static int read_timeout(int fd, char *buf, int len)
} }
if (n == 0) { if (n == 0) {
if (eof_error) {
rprintf(FERROR,"EOF in read_timeout\n"); rprintf(FERROR,"EOF in read_timeout\n");
}
exit_cleanup(1); exit_cleanup(1);
} }
...@@ -482,8 +485,12 @@ void write_byte(int f,unsigned char c) ...@@ -482,8 +485,12 @@ void write_byte(int f,unsigned char c)
int read_line(int f, char *buf, int maxlen) int read_line(int f, char *buf, int maxlen)
{ {
eof_error = 0;
while (maxlen) { while (maxlen) {
buf[0] = 0;
read_buf(f, buf, 1); read_buf(f, buf, 1);
if (buf[0] == 0) return 0;
if (buf[0] == '\n') { if (buf[0] == '\n') {
buf[0] = 0; buf[0] = 0;
break; break;
...@@ -497,6 +504,9 @@ int read_line(int f, char *buf, int maxlen) ...@@ -497,6 +504,9 @@ int read_line(int f, char *buf, int maxlen)
*buf = 0; *buf = 0;
return 0; return 0;
} }
eof_error = 1;
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment