diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-09-08 20:41:49 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-09-08 20:41:49 +0000 |
commit | 9a9abfac2b38bfa8b347a6607c2aa78524d4bc36 (patch) | |
tree | 211fecf8aded9a6b57135701c90a4fe6547e5ccc /x11-toolkits/plib | |
parent | Use the default MTREE_FILE. (diff) |
- Forgot to add the patch itself
Reported by: pointyhat via pav
Notes
Notes:
svn path=/head/; revision=241053
Diffstat (limited to 'x11-toolkits/plib')
-rw-r--r-- | x11-toolkits/plib/files/extra-patch-src-js-jsBSD.cxx | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/x11-toolkits/plib/files/extra-patch-src-js-jsBSD.cxx b/x11-toolkits/plib/files/extra-patch-src-js-jsBSD.cxx new file mode 100644 index 000000000000..55e6e7664d2c --- /dev/null +++ b/x11-toolkits/plib/files/extra-patch-src-js-jsBSD.cxx @@ -0,0 +1,65 @@ +--- src/js/jsBSD.cxx.orig 2008-03-11 05:06:21.000000000 +0300 ++++ src/js/jsBSD.cxx 2009-09-04 19:20:14.000000000 +0400 +@@ -66,6 +66,7 @@ + # else + # define HAVE_USBHID_H 1 + # include <usbhid.h> ++# include <dev/usb/usb_ioctl.h> + # endif + } + #endif +@@ -116,54 +117,12 @@ + static char * + walkusbdev(int f, char *dev, char *out, int outlen) + { +- struct usb_device_info di; +- int i, a; +- char *cp; +- +- for (a = 1; a < USB_MAX_DEVICES; a++) { +- di.udi_addr = a; +- if (ioctl(f, USB_DEVICEINFO, &di) != 0) +- return NULL; +- for (i = 0; i < USB_MAX_DEVNAMES; i++) +- if (di.udi_devnames[i][0] && +- strcmp(di.udi_devnames[i], dev) == 0) { +- cp = new char[strlen(di.udi_vendor) + strlen(di.udi_product) + 2]; +- strcpy(cp, di.udi_vendor); +- strcat(cp, " "); +- strcat(cp, di.udi_product); +- strncpy(out, cp, outlen - 1); +- out[outlen - 1] = 0; +- delete cp; +- return out; +- } +- } + return NULL; + } + + static int + findusbdev(char *name, char *out, int outlen) + { +- int i, f; +- char buf[50]; +- char *cp; +- static int protection_warned = 0; +- +- for (i = 0; i < 16; i++) { +- sprintf(buf, "%s%d", USBDEV, i); +- f = open(buf, O_RDONLY); +- if (f >= 0) { +- cp = walkusbdev(f, name, out, outlen); +- close(f); +- if (cp) +- return 1; +- } else if (errno == EACCES) { +- if (!protection_warned) { +- fprintf(stderr, "Can't open %s for read!\n", +- buf); +- protection_warned = 1; +- } +- } +- } + return 0; + } + |