summaryrefslogtreecommitdiff
path: root/usr.bin/audioctl
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-01-30 05:17:08 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-01-30 05:17:08 +0000
commit5492478e6181173eae5dadab6e76d5dc8b4f0d99 (patch)
treebc8707d7125d6b512679f6fb6eaaf8d4ba4f85eb /usr.bin/audioctl
parent6be2669006162471e5f4e65300214b6149cd3317 (diff)
Don't open the device for reading.
Diffstat (limited to 'usr.bin/audioctl')
-rw-r--r--usr.bin/audioctl/audioctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c
index 4b84f158e84..1a53bdbc4e4 100644
--- a/usr.bin/audioctl/audioctl.c
+++ b/usr.bin/audioctl/audioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audioctl.c,v 1.37 2019/06/28 13:35:00 deraadt Exp $ */
+/* $OpenBSD: audioctl.c,v 1.38 2020/01/30 05:17:07 ratchov Exp $ */
/*
* Copyright (c) 2016 Alexandre Ratchov <alex@caoua.org>
*
@@ -217,12 +217,12 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if (unveil(path, "rw") == -1)
+ if (unveil(path, "w") == -1)
err(1, "unveil");
if (unveil(NULL, NULL) == -1)
err(1, "unveil");
- fd = open(path, O_RDWR);
+ fd = open(path, O_WRONLY);
if (fd == -1)
err(1, "%s", path);
if (ioctl(fd, AUDIO_GETSTATUS, &rstatus) == -1)