Minor ftpget fix

From: Pete Bentley <pete@dont-contact.us>
Date: Wed, 03 Jul 1996 11:19:10 +0100

There seems to be a situation (under IRIX at least) where ftpget can
spin-loop because it gets EOF on it's command socket. I'm not quite
sure how this arises (possibly a race between the socket getting
opened and the client cancelling the transfer), but this patch at least
stops it soaking up all available CPU:-

--- ftpget.c 1996/07/02 15:27:49 1.6
+++ ftpget.c 1996/07/03 10:13:54
@@ -2383,7 +2383,7 @@
        if (fcntl(c, F_SETFL, flags) < 0)
            log_errno2(__FILE__, __LINE__, "fcntl F_SETFL");
        do {
- if ((n = read(c, &buf[buflen], BUFSIZ - buflen - 1)) < 0) {
+ if ((n = read(c, &buf[buflen], BUFSIZ - buflen - 1)) <= 0) {
                log_errno2(__FILE__, __LINE__, "read");
                close(c);
                _exit(1);

Pete.
Received on Wed Jul 03 1996 - 03:21:02 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:34 MST