please test this patch

David Mosberger-Tang (David.Mosberger@acm.org)
Sat, 14 Feb 1998 15:48:54 -0800

Could folks running Linux please test the following change? You can
apply the change on top of sane-0.70 with:

cd wherever/sane-0.70
patch -p1 <PATCHFILE

Then rebuild with "make clean; make" and then "make install" as root.

Should the patch have any negative effect on the operation of your
scanner, please send me a detailed bug report (scanner model, error
encountered, debug output etc. ;-).

Non-Linux platforms will need a similar patch to make certain scanners
work (those scanners return a sense code of NOT READY when the scanner
is busy). But I'd need patches from people who can test the changes.

Thanks,

--david

--- sane-0.70/sanei/sanei_scsi.c Mon Jan 26 23:41:50 1998
+++ sane-pre0.71/sanei/sanei_scsi.c Sat Feb 14 15:41:17 1998
@@ -671,7 +726,8 @@
{
nread -= sizeof (req->cdb.hdr);

- if (req->cdb.hdr.result == 0)
+ if (req->cdb.hdr.result == 0
+ && (req->cdb.hdr.sense_buffer[0] & 0x7f) == 0)
{
if (req->dst)
memcpy (req->dst, req->cdb.data, nread);
@@ -685,15 +741,14 @@
{
SANEI_SCSI_Sense_Handler handler
= fd_info[req->fd].sense_handler;
- void *arg
- = fd_info[req->fd].sense_handler_arg;
+ void *arg = fd_info[req->fd].sense_handler_arg;

DBG(1, "sanei_scsi_req_wait: SCSI command failed: %s\n",
strerror (req->cdb.hdr.result));

if (req->cdb.hdr.result == EBUSY)
status = SANE_STATUS_DEVICE_BUSY;
- else if ((req->cdb.hdr.sense_buffer[0] & 0x80) && handler)
+ else if (handler)
status = (*handler) (req->fd, req->cdb.hdr.sense_buffer, arg);
else
status = SANE_STATUS_IO_ERROR;

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com