FreeBSD Bugzilla – Attachment 25747 Details for
Bug 43993
/usr/sbin/usbd does not handle an usb event with multiple devices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.90 KB, created by
Naoyuki Tai
on 2002-10-13 04:00:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Naoyuki Tai
Created:
2002-10-13 04:00:09 UTC
Size:
2.90 KB
patch
obsolete
>*** usbd.c.orig Sun Feb 24 09:23:13 2002 >--- usbd.c Sat Oct 12 22:43:14 2002 >*************** >*** 826,831 **** >--- 826,835 ---- > int error; > int len; > action_match_t action_match; >+ int i; >+ struct usb_event one_event; >+ struct usb_device_info *one_devinfo; >+ struct usb_device_info *devinfo; > > for (;;) { > len = read(fd, &event, sizeof(event)); >*************** >*** 851,888 **** > if (verbose) > print_event(&event); > >! /* handle the event appropriately */ >! switch (event.ue_type) { >! case USB_EVENT_ATTACH: >! case USB_EVENT_DETACH: >! if (find_action(&event.ue_device, &action_match) == 0) >! /* nothing found */ > break; > >! if (verbose >= 2) >! print_action(action_match.action, 0); > >- if (action_match.devname) { > if (verbose >= 2) >! printf("%s: Setting DEVNAME='%s'\n", > __progname, action_match.devname); > >! error = setenv("DEVNAME", action_match.devname, 1); >! if (error) >! fprintf(stderr, "%s: setenv(\"DEVNAME\", \"%s\",1) failed, %s\n", >! __progname, action_match.devname, strerror(errno)); > } >- >- if (event.ue_type == USB_EVENT_ATTACH && action_match.action->attach) >- execute_command(action_match.action->attach); >- if (event.ue_type == USB_EVENT_DETACH && action_match.action->detach) >- execute_command(action_match.action->detach); >- >- break; >- default: >- printf("Unknown USB event %d\n", event.ue_type); > } >! } > } > > >--- 855,903 ---- > if (verbose) > print_event(&event); > >! devinfo = &event.ue_device; >! >! for (i = 0; i < MAXDEVNAMES; i++) { >! if (devinfo->udi_devnames[i][0] == '\0') > break; > >! memcpy(&one_event, &event, sizeof(one_event)); >! one_devinfo = &one_event.ue_device; >! memcpy(&one_devinfo->udi_devnames[0], &devinfo->udi_devnames[i], sizeof(one_devinfo->udi_devnames[0])); >! one_devinfo->udi_devnames[1][0] = '\0'; >! >! /* handle the event appropriately */ >! switch (one_event.ue_type) { >! case USB_EVENT_ATTACH: >! case USB_EVENT_DETACH: >! if (find_action(&one_event.ue_device, &action_match) == 0) >! /* nothing found */ >! break; > > if (verbose >= 2) >! print_action(action_match.action, 0); >! >! if (action_match.devname) { >! if (verbose >= 2) >! printf("%s: Setting DEVNAME='%s'\n", > __progname, action_match.devname); > >! error = setenv("DEVNAME", action_match.devname, 1); >! if (error) >! fprintf(stderr, "%s: setenv(\"DEVNAME\", \"%s\",1) failed, %s\n", >! __progname, action_match.devname, strerror(errno)); >! } >! >! if (one_event.ue_type == USB_EVENT_ATTACH && action_match.action->attach) >! execute_command(action_match.action->attach); >! if (one_event.ue_type == USB_EVENT_DETACH && action_match.action->detach) >! execute_command(action_match.action->detach); >! break; >! default: >! printf("Unknown USB event %d\n", one_event.ue_type); > } > } >! } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43993
: 25747 |
25748