Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 181961 Details for
Bug 250482
memory leak caused by USBDEVFS_BULK transfers immediately before process exit
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test program
libusb_test.c (text/plain), 1.98 KB, created by
Sam Bishop
on 2007-08-30 20:42:51 UTC
(
hide
)
Description:
test program
Filename:
MIME Type:
Creator:
Sam Bishop
Created:
2007-08-30 20:42:51 UTC
Size:
1.98 KB
patch
obsolete
>#include <stdlib.h> >#include <stdio.h> >#include <string.h> > >#include <fcntl.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <time.h> >#include <unistd.h> > >#include <usb.h> > >static const unsigned VENDOR_ID = 0x0634; >static const unsigned PRODUCT_ID = 0x2000; > >struct usb_dev_handle *find_device() >{ > struct usb_dev_handle *handle; > struct usb_bus *bus; > struct usb_device *dev; > > for (bus = usb_get_busses(); bus; bus = bus->next) { > for (dev = bus->devices; dev; dev = dev->next) { > if (dev->descriptor.idVendor != VENDOR_ID > || dev->descriptor.idProduct != PRODUCT_ID) > continue; > > handle = usb_open(dev); > if (!handle) { > fprintf(stderr, "unable to open device\n"); > exit(2); > } > > if (usb_claim_interface(handle, 0) < 0) { > fprintf(stderr, "unable to claim interface\n"); > exit(2); > } > > return handle; > } > } > > return NULL; >} > >int main(int argc, char **argv) >{ > struct usb_dev_handle *handle; > ssize_t ret; > char buf[42] = { 0x15, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 }; > > if (argc == 1) { > fprintf(stderr, "Usage: %s <word> [<word>...]\n", argv[0]); > exit(1); > } > > usb_init(); > usb_find_busses(); > usb_find_devices(); > > handle = find_device(); > if (!handle) { > fprintf(stderr, "unable to find device\n"); > exit(2); > } > > while (*++argv) { > strncpy(&buf[6], *argv, sizeof(buf) - 7); > > /* Write the word to an LCD screen on the tester. */ > ret = usb_bulk_write(handle, 0x02, buf, sizeof(buf), 3000); > > if (0) { > struct timespec wait_length; > wait_length.tv_sec = 1; > wait_length.tv_nsec = 0; > nanosleep(&wait_length, NULL); > } > } > > if (usb_release_interface(handle, 0) < 0) { > fprintf(stderr, "unable to release interface\n"); > exit(2); > } > > return 0; >} >
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 Raw
Actions:
View
Attachments on
bug 250482
:
160461
| 181961 |
184321
|
205651