[sane-devel] Epson Perfection 1650 on FreeBSD

JJ Behrens jj@nttmcl.com
Fri, 25 Jan 2002 12:30:08 -0800 (PST)


> Edit the file epson.c in Sane's backend directory. Search for the string
> TEST_IOCTL and make sure that the #define statment is commented out. 
> This should disable the ioctl. 

Karl,

Thanks for this second reply. Line 229 was already commented out as you've
suggested:

/* #define TEST_IOCTL */

Nonetheless, I feared that TEST_IOCTL might be getting defined elsewhere,
so I replaced line 1720:

#ifdef TEST_IOCTL

with:

#ifdef TEST_IOCTL
warning "TEST_IOCTL is set. This will not work under FreeBSD."

and recompiled. The compilation was successful, thus proving that
TEST_IOCTL is not being defined. 

It is interesting that at line 1752, the code is:

#ifdef TEST_IOCTL
                /* read the vendor and product IDs via the IOCTLs */
                if (ioctl(s->fd, IOCTL_SCANNER_VENDOR , &vendorID) == -1)
                {
                        /* just set the vendor ID to 0 */
                        vendorID = 0;
                }
                if (ioctl(s->fd, IOCTL_SCANNER_PRODUCT , &productID) ==
-1)
                {
                        /* just set the product ID to 0 */
                        productID = 0;
                }

This is the only place in epson.c that uses an ioctl, yet this code is not
being compiled in. Hence, there must be an ioctl being used elsewhere.
Tough little bugger to find!

Thanks Again,
-jj