HP/UX 10.20 patch for find-scanner

Petter Reinholdtsen (pere@hungry.com)
Mon, 14 Dec 1998 00:18:08 +0100 (MET)

Here is a patch for SANE 1.00 on HP/UX 10.20. It gives find-scanner
the SCSI devices to search on HP/UX, and cleans up the output when
using verbose. I'm not sure how many scsi id are available. Maybe
its only 0-7 or even 0-15. On my system only 0,5,7 is used.

diff -ru src-1.00/tools/find-scanner.c src-1.00-hppa20ux10/tools/find-scanner.c
--- src-1.00/tools/find-scanner.c Fri Jul 31 06:48:19 1998
+++ src-1.00-hppa20ux10/tools/find-scanner.c Mon Dec 14 00:13:14 1998
@@ -356,6 +356,15 @@
#elif defined(__FreeBSD__)
"/dev/uk0", "/dev/uk1", "/dev/uk2", "/dev/uk3", "/dev/uk4",
"/dev/uk5", "/dev/uk6",
+#elif defined(__hpux__)
+ /* First controller, id 0-8 */
+ "/dev/rscsi/c0t0d0", "/dev/rscsi/c0t1d0", "/dev/rscsi/c0t2d0",
+ "/dev/rscsi/c0t3d0", "/dev/rscsi/c0t4d0", "/dev/rscsi/c0t5d0",
+ "/dev/rscsi/c0t6d0", "/dev/rscsi/c0t7d0", "/dev/rscsi/c0t8d0",
+ /* Second controller id 0-8 */
+ "/dev/rscsi/c1t0d0", "/dev/rscsi/c1t1d0", "/dev/rscsi/c1t2d0",
+ "/dev/rscsi/c1t3d0", "/dev/rscsi/c1t4d0", "/dev/rscsi/c1t5d0",
+ "/dev/rscsi/c1t6d0", "/dev/rscsi/c1t7d0", "/dev/rscsi/c1t8d0",
#endif
0
};
@@ -372,9 +381,21 @@
printf ("%s: searching for scanners:\n", prog_name);
while ((dev_name = *dev_list++))
{
+ int result;
if (verbose)
- printf ("%s: checking %s...\n", prog_name, dev_name);
- if (sanei_scsi_open (dev_name, &sfd, NULL, NULL) == 0)
+ printf ("%s: checking %s...", prog_name, dev_name);
+
+ result = sanei_scsi_open (dev_name, &sfd, NULL, NULL);
+
+ if (verbose)
+ {
+ if (result != 0)
+ printf (" failed to open\n");
+ else
+ printf (" open ok\n");
+ }
+
+ if (result == 0)
{
scanner_identify_scanner (buffer, sfd, dev_name);
sanei_scsi_close (sfd);

-- 
##>  Petter Reinholdtsen <##    | pere@td.org.uit.no
 O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
http://www.hungry.com/~pere/    | Go Mozilla, go! Go!

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