Maxime Villard <[email protected]> writes:
> Is there something wrong with this patch?
Nope, there is something wrong with ftp(1) and how it recovers from the
error. I'll commit this tomorrow unless someone disagrees.
> Le 29/11/2013 20:44, Maxime Villard a écrit :
>> What about that?
>>
>> Index: ftp.c
>> ===================================================================
>> RCS file: /cvs/src/usr.bin/ftp/ftp.c,v
>> retrieving revision 1.83
>> diff -u -r1.83 ftp.c
>> --- ftp.c 13 Nov 2013 20:41:14 -0000 1.83
>> +++ ftp.c 29 Nov 2013 21:17:49 -0000
>> @@ -1089,9 +1089,10 @@
>> may_send_noop_char();
>> d = 0;
>> do {
>> - wr = write(fileno(fout), buf + d, rd);
>> - if (wr == -1 && errno == EPIPE)
>> + if ((wr = write(fileno(fout), buf + d, rd)) ==
>> -1) {
>> + d = -1;
>> break;
>> + }
>> d += wr;
>> rd -= wr;
>> } while (d < c);
>>
>>
>> p is set to -1 to display the proper error message
>
> of course here I meant 'd'
>
>>
>>
--
jca | PGP: 0x06A11494 / 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494