usr/src/cmd/cups/Patches/08-usb-hack.patch
changeset 5 d07534556b03
parent 3 ad3552f8e1ef
equal deleted inserted replaced
4:834920bc5f09 5:d07534556b03
     1 --- backend/usb-unix.c	Mon Aug 31 11:45:43 2009
     1 --- backend/usb-unix.c.orig	Tue Sep 22 11:47:36 2009
     2 +++ backend/usb-unix.c	Thu Oct  1 15:26:12 2009
     2 +++ backend/usb-unix.c	Sat Nov 28 06:16:25 2009
     3 
       
     4 @@ -30,7 +30,11 @@
     3 @@ -30,7 +30,11 @@
     5  
     4  
     6  #include <sys/select.h>
     5  #include <sys/select.h>
     7  
     6  
     8 +#ifdef __sun
     7 +#ifdef __sun
    11  
    10  
    12 +
    11 +
    13  /*
    12  /*
    14   * Local functions...
    13   * Local functions...
    15   */
    14   */
    16 @@ -470,6 +470,8 @@
    15 @@ -470,6 +474,8 @@
    17      {
    16      {
    18        for (i = 0, busy = 0; i < 8; i ++)
    17        for (i = 0, busy = 0; i < 8; i ++)
    19        {
    18        {
    20 +        char *s;
    19 +        char *s;
    21 +
    20 +
    22  	sprintf(device, "/dev/usb/printer%d", i);
    21  	sprintf(device, "/dev/usb/printer%d", i);
    23  
    22  
    24  	if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
    23  	if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
    25 @@ -489,6 +491,16 @@
    24 @@ -489,6 +495,16 @@
    26  	  device_uri[0] = '\0';
    25  	  device_uri[0] = '\0';
    27          }
    26          }
    28  
    27  
    29 +        /*
    28 +        /*
    30 +         * The serial# is often missing from the 1284 devid and retrieval from
    29 +         * The serial# is often missing from the 1284 devid and retrieval from
    37 +        }
    36 +        }
    38 +
    37 +
    39          if (!strcmp(uri, device_uri))
    38          if (!strcmp(uri, device_uri))
    40  	{
    39  	{
    41  	 /*
    40  	 /*
    42 @@ -560,7 +572,7 @@
       
    43   * 'side_cb()' - Handle side-channel requests...
       
    44   */
       
    45  
       
    46 -static void
       
    47 +static int
       
    48  side_cb(int         print_fd,		/* I - Print file */
       
    49          int         device_fd,		/* I - Device file */
       
    50          int         snmp_fd,		/* I - SNMP socket (unused) */