=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mixerctl/mixerctl.c,v retrieving revision 1.32 retrieving revision 1.33 diff -c -r1.32 -r1.33 *** src/usr.bin/mixerctl/mixerctl.c 2019/06/28 13:35:02 1.32 --- src/usr.bin/mixerctl/mixerctl.c 2020/04/04 08:43:08 1.33 *************** *** 1,4 **** ! /* $OpenBSD: mixerctl.c,v 1.32 2019/06/28 13:35:02 deraadt Exp $ */ /* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: mixerctl.c,v 1.33 2020/04/04 08:43:08 ratchov Exp $ */ /* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */ /* *************** *** 249,255 **** int ndev; if ((file = getenv("MIXERDEVICE")) == 0 || *file == '\0') ! file = "/dev/mixer"; while ((ch = getopt(argc, argv, "af:nqtvw")) != -1) { switch (ch) { --- 249,255 ---- int ndev; if ((file = getenv("MIXERDEVICE")) == 0 || *file == '\0') ! file = "/dev/audioctl0"; while ((ch = getopt(argc, argv, "af:nqtvw")) != -1) { switch (ch) { *************** *** 284,302 **** if (argc == 0 && tflag == 0) aflag = 1; ! if (unveil(file, "rw") == -1) err(1, "unveil"); - if ((fd = open(file, O_RDWR)) == -1) { - if (unveil(file, "r") == -1) - err(1, "unveil"); - - if ((fd = open(file, O_RDONLY)) == -1) - err(1, "%s", file); - } - if (unveil(NULL, NULL) == -1) err(1, "unveil"); for (ndev = 0; ; ndev++) { dinfo.index = ndev; --- 284,297 ---- if (argc == 0 && tflag == 0) aflag = 1; ! if (unveil(file, "w") == -1) err(1, "unveil"); if (unveil(NULL, NULL) == -1) err(1, "unveil"); + + if ((fd = open(file, O_WRONLY)) == -1) + err(1, "%s", file); for (ndev = 0; ; ndev++) { dinfo.index = ndev;