[sane-devel] xscanimage handling for non-blocking fd

James A. Littlefield jal@alum.mit.edu
Sun, 22 Aug 2004 18:14:05 -0400


I have run across another issue during DS3000 backend testing.    When 
using xscanimage if I let scans run to completion everything is fine.    
If I use the "Cancel" button in the scan progress window the button 
stays depressed,  the scanner correctly aborts the scan and returns to 
home,  but the scan progress window remains open (with cancel button 
depressed), and the main xscanimage window has the "Scan" button 
disabled.     This behavior occurs if I have the backend compiled to 
support both sane_get_select_fd() and also sane_set_io_mode() with 
non-blocking I/O support.       If I recompile the chinon backend to 
support only blocking io then the cancel feature works correctly.

After some poking around w/ gdb I have developed a theory that when the 
scan is cancelled and the pipe between the reader_process and xscanimage 
is closed this is causing an exception condition on the fd returned by 
sane_get_select_fd().    Somehow this causes the event handling in 
xscanimage to hang....

Has anyone seem similar behavior w/ other backends that support both the 
select fd and non-blocking io?    Any suggestions/tips appreciated.

Jim