X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e92ee12893ca6320f5331384b2c2e8560ca9c88a..c3563c46ed40c3021b61f5ed228c9eca2d64e1f3:/io.c diff --git a/io.c b/io.c index 2f4162cd..39996885 100644 --- a/io.c +++ b/io.c @@ -1,5 +1,6 @@ -/* - Copyright (C) Andrew Tridgell 1996 +/* -*- c-file-style: "linux" -*- + + Copyright (C) 1996-2000 by Andrew Tridgell Copyright (C) Paul Mackerras 1996 This program is free software; you can redistribute it and/or modify @@ -103,9 +104,15 @@ static void read_error_fd(void) static int no_flush; -/* read from a socket with IO timeout. return the number of - bytes read. If no bytes can be read then exit, never return - a number <= 0 */ +/* + * Read from a socket with IO timeout. return the number of bytes + * read. If no bytes can be read then exit, never return a number <= 0. + * + * TODO: If the remote shell connection fails, then current versions actually + * report an "unexpected EOF" error here. Since it's a fairly common mistake + * to try to use rsh when ssh is required, we should trap that: if we fail + * to read any data at all, we should give a better explanation. + */ static int read_timeout(int fd, char *buf, int len) { int n, ret=0; @@ -455,6 +462,8 @@ void io_flush(void) io_buffer_count = 0; } + +/* XXX: fd is ignored, which seems a little strange. */ void io_end_buffering(int fd) { io_flush(); @@ -505,6 +514,11 @@ void write_int(int f,int32 x) writefd(f,b,4); } + +/* + * Note: int64 may actually be a 32-bit type if ./configure couldn't find any + * 64-bit types on this platform. + */ void write_longint(int f, int64 x) { extern int remote_version;