=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/ftp.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/ftp/ftp.c 1998/09/19 20:47:16 1.31 --- src/usr.bin/ftp/ftp.c 1998/09/19 23:00:50 1.32 *************** *** 1,4 **** ! /* $OpenBSD: ftp.c,v 1.31 1998/09/19 20:47:16 millert Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ftp.c,v 1.32 1998/09/19 23:00:50 deraadt Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.31 1998/09/19 20:47:16 millert Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.32 1998/09/19 23:00:50 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 927,933 **** } errno = d = 0; while ((c = read(fileno(din), buf, bufsize)) > 0) { ! if ((d = write(fileno(fout), buf, (size_t)c)) != c) break; bytes += c; if (hash && (!progress || filesize < 0)) { --- 927,944 ---- } errno = d = 0; while ((c = read(fileno(din), buf, bufsize)) > 0) { ! size_t wr; ! size_t rd = c; ! ! d = 0; ! do { ! wr = write(fileno(fout), buf + d, rd); ! if (wr == -1 && errno == EPIPE) ! break; ! d += wr; ! rd -= wr; ! } while (d < c); ! if (rd != 0) break; bytes += c; if (hash && (!progress || filesize < 0)) {