Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search /dev/ttyUSB%d as well as /dev/usb/ttyUSB%d #2061

Closed
michaelrsweet opened this issue Oct 27, 2006 · 3 comments
Closed

Search /dev/ttyUSB%d as well as /dev/usb/ttyUSB%d #2061

michaelrsweet opened this issue Oct 27, 2006 · 3 comments

Comments

@michaelrsweet
Copy link
Contributor

@michaelrsweet michaelrsweet commented Oct 27, 2006

Version: 1.2.5
CUPS.org User: twaugh.redhat

The serial backend needs to search /dev/ttyUSB%d as well as /dev/usb/ttyUSB%d as both have been used at various times. FC6 uses /dev/ttyUSB%d FWIW.

@michaelrsweet
Copy link
Contributor Author

@michaelrsweet michaelrsweet commented Oct 27, 2006

CUPS.org User: mike

Fixed in Subversion repository.

Gotta love how the kernel developers change things for no good reason...

I committed a slightly different patch (attached)...

@michaelrsweet
Copy link
Contributor Author

@michaelrsweet michaelrsweet commented Oct 27, 2006

"cups-ttyUSB.patch":

--- cups-1.2.5/backend/serial.c.ttyUSB 2006-10-27 13:01:51.000000000 +0100
+++ cups-1.2.5/backend/serial.c 2006-10-27 13:01:52.000000000 +0100
@@ -769,14 +769,17 @@
}
}

  • for (i = 0; i < 16; i ++)
  • for (i = 0; i < 2; i ++)
    {
  • sprintf(device, "/dev/usb/ttyUSB%d", i);
  • if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
  • for (j = 0; j < 16; j++)
    {
  •  close(fd);
    
  •  printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
    
  •         device, i + 1);
    
  •  sprintf(device, "/dev/%sttyUSB%d", i ? "" : "usb/", j);
    
  •  if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
    
  •  {
    
  •    close(fd);
    
  •    printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
    
  •           device, j + 1);
    
  •  }
    
    }
    }
@michaelrsweet
Copy link
Contributor Author

@michaelrsweet michaelrsweet commented Oct 27, 2006

"str2061.patch":

Index: serial.c

--- serial.c (revision 6065)
+++ serial.c (working copy)
@@ -778,6 +778,14 @@
printf("serial serial:%s?baud=230400 "Unknown" "USB Serial Port #%d"\n",
device, i + 1);
}
+

  • sprintf(device, "/dev/ttyUSB%d", i);
  • if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
  • {
  •  close(fd);
    
  •  printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
    
  •         device, i + 1);
    
  • }
    }

for (i = 0; i < 64; i ++)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant