Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
usb backend busy-loops due to runloop logic error #2664
A logic error in backend/runloop.c causes the usb backend to use very much more power than it needs to.
The situation that triggers this is that backendRunLoop() is entered with use_bc==0 and side_cb!=NULL.
When print_bytes==0 in this situation, I think that this piece of code:
is trying to add device_fd to the output set if the select() call will be skipped. This worked up until revision 6170, which added the side_cb parts.
A patch to fix the logic error is attached. Original bug report:
diff -up cups-1.3.5/backend/runloop.c~ cups-1.3.5/backend/runloop.c
if (use_bc || side_cb)