[cups.bugs] [MOD] STR #3001: backend runloop spins on backchannel EOF
Michael R Sweet
msweet at apple.com
Sun Nov 16 10:17:14 PST 2008
Martin Pitt wrote:
> ...
>> --- backend/runloop.c (revision 8127)
>> +++ backend/runloop.c (working copy)
>> @@ -283,6 +283,12 @@
>> CUPS_LLCAST bc_bytes);
>> cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
>> }
>> + else if (bc_bytes < 0 && errno != EAGAIN && errno != EINTR)
>
> So this doesn't check for EOF at all (which would be bc_bytes == 0),
> but for an error condition. Maybe it could do both, just to be on the
> safe side? (log a different error for the EOF case, of course, since
> errno will be 0).
Reading from a socket that has been closed by the printer will return
-1 with ECONNRESET. Similarly, character devices using this function
will return -1 and EIO when there is an error and never EOF since we
run them in raw mode.
--
______________________________________________________________________
Michael R Sweet Senior Printing System Engineer
More information about the cups-devel
mailing list