artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a63813
)
Only open with O_RDWR if we are actually chaging a report descriptor, other
author
miod
<miod@openbsd.org>
Mon, 2 Aug 2010 13:57:32 +0000
(13:57 +0000)
committer
miod
<miod@openbsd.org>
Mon, 2 Aug 2010 13:57:32 +0000
(13:57 +0000)
operations only need O_RDONLY.
ok blambert@ deraadt@
usr.bin/usbhidctl/usbhid.c
patch
|
blob
|
history
diff --git
a/usr.bin/usbhidctl/usbhid.c
b/usr.bin/usbhidctl/usbhid.c
index
896186d
..
4646dd6
100644
(file)
--- a/
usr.bin/usbhidctl/usbhid.c
+++ b/
usr.bin/usbhidctl/usbhid.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: usbhid.c,v 1.
9 2008/10/16 18:37:19 jakemsr Exp $
*/
+/* $OpenBSD: usbhid.c,v 1.
10 2010/08/02 13:57:32 miod Exp $
*/
/* $NetBSD: usbhid.c,v 1.22 2002/02/20 20:30:42 christos Exp $ */
/*
@@
-937,7
+937,7
@@
main(int argc, char **argv)
dev = devnamebuf;
}
- hidfd = open(dev,
O_RDWR
);
+ hidfd = open(dev,
wflag ? O_RDWR : O_RDONLY
);
if (hidfd < 0)
err(1, "%s", dev);