summaryrefslogtreecommitdiffstats
path: root/usr.bin/usbhidaction/usbhidaction.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-06-30 03:58:01 +0000
committerimp <imp@FreeBSD.org>2007-06-30 03:58:01 +0000
commite3b9f0fc2d5cc18662a37cb7c89500cc95d34e38 (patch)
tree7d8e679ad7c66187d9e3101ede31755edc420a99 /usr.bin/usbhidaction/usbhidaction.c
parent665642a3f2aeadb5d5bd42bab15d52f405ec6b1c (diff)
downloadFreeBSD-src-e3b9f0fc2d5cc18662a37cb7c89500cc95d34e38.zip
FreeBSD-src-e3b9f0fc2d5cc18662a37cb7c89500cc95d34e38.tar.gz
Add support using an alternate table file to usbhidaction(1).
Submitted by: Michael Haro PR: 61234 Approved by: re (bmah)
Diffstat (limited to 'usr.bin/usbhidaction/usbhidaction.c')
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c
index e1f67b0..e0d459d 100644
--- a/usr.bin/usbhidaction/usbhidaction.c
+++ b/usr.bin/usbhidaction/usbhidaction.c
@@ -93,6 +93,7 @@ main(int argc, char **argv)
{
const char *conf = NULL;
const char *dev = NULL;
+ const char *table = NULL;
int fd, fp, ch, n, val, i;
size_t sz, sz1;
int demon, ignore, dieearly;
@@ -105,7 +106,7 @@ main(int argc, char **argv)
demon = 1;
ignore = 0;
dieearly = 0;
- while ((ch = getopt(argc, argv, "c:def:ip:v")) != -1) {
+ while ((ch = getopt(argc, argv, "c:def:ip:t:v")) != -1) {
switch(ch) {
case 'c':
conf = optarg;
@@ -125,6 +126,9 @@ main(int argc, char **argv)
case 'p':
pidfile = optarg;
break;
+ case 't':
+ table = optarg;
+ break;
case 'v':
demon = 0;
verbose++;
@@ -140,7 +144,7 @@ main(int argc, char **argv)
if (conf == NULL || dev == NULL)
usage();
- hid_init(NULL);
+ hid_init(table);
if (dev[0] != '/') {
snprintf(devnamebuf, sizeof(devnamebuf), "/dev/%s%s",
@@ -245,7 +249,7 @@ usage(void)
{
fprintf(stderr, "Usage: %s [-deiv] -c config_file -f hid_dev "
- "[-p pidfile]\n", getprogname());
+ "[-p pidfile] [-t tablefile]\n", getprogname());
exit(1);
}
OpenPOWER on IntegriCloud