Annotation of /trunk/sane-backends/patches/sane-backends-1.0.18-udev-rule.patch
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1307 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1307 byte(s)
-import
1 | niro | 153 | --- tools/sane-desc.c 2006-07-31 08:57:40.000000000 +0200 |
2 | +++ tools/sane-desc-new.c 2006-07-31 09:10:50.000000000 +0200 | ||
3 | @@ -3151,7 +3151,7 @@ | ||
4 | |||
5 | printf | ||
6 | ("#\n" | ||
7 | - "# udev rules file for supported USB devices\n" | ||
8 | + "# udev rules file for supported USB and SCSI devices\n" | ||
9 | "#\n" | ||
10 | "# To add a USB device, add a rule to the list below between the SUBSYSTEM...\n" | ||
11 | "# and LABEL... lines.\n" | ||
12 | @@ -3169,21 +3169,28 @@ | ||
13 | static void | ||
14 | print_udev (void) | ||
15 | { | ||
16 | + int commentlen; | ||
17 | usbid_type *usbid = create_usbids_table (); | ||
18 | |||
19 | print_udev_header (); | ||
20 | printf ("\nACTION!=\"add\", GOTO=\"libsane_rules_end\"\n"); | ||
21 | + puts("BUS==\"scsi\", SYSFS{type}==\"6\", MODE=\"660\", GROUP=\"scanner\""); | ||
22 | printf ("SUBSYSTEM!=\"usb_device\", GOTO=\"libsane_rules_end\"\n\n"); | ||
23 | while (usbid) | ||
24 | { | ||
25 | manufacturer_model_type * name = usbid->name; | ||
26 | |||
27 | - printf ("# "); | ||
28 | + commentlen = printf ("# "); | ||
29 | while (name) | ||
30 | { | ||
31 | - if (name != usbid->name) | ||
32 | - printf (" | "); | ||
33 | - printf ("%s", name->name); | ||
34 | + if (name != usbid->name) { | ||
35 | + commentlen += printf (" | "); | ||
36 | + } | ||
37 | + if(commentlen + strlen(name->name) > 480) { | ||
38 | + printf(" (line too long, names omitted)"); | ||
39 | + break; | ||
40 | + } | ||
41 | + commentlen += printf ("%s", name->name); | ||
42 | name = name->next; | ||
43 | } | ||
44 | printf ("\n"); |