diff options
author | 2016-01-20 19:01:39 +0000 | |
---|---|---|
committer | 2016-01-20 19:01:39 +0000 | |
commit | 9f7eb5cfc865cc57599736043fafd7d256a5de14 (patch) | |
tree | e29cbf6882324da8ce3f35a674e459ce82f93f99 | |
parent | fix year (diff) | |
download | wireguard-openbsd-9f7eb5cfc865cc57599736043fafd7d256a5de14.tar.xz wireguard-openbsd-9f7eb5cfc865cc57599736043fafd7d256a5de14.zip |
make AUDIO_GETDEV ioctl return the device name (ex "azalia0") rather
than driver specific strings.
ok kettenis
-rw-r--r-- | sys/dev/audio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index c0f079ed1c8..cc6e8ccd29f 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.142 2016/01/20 07:59:55 ratchov Exp $ */ +/* $OpenBSD: audio.c,v 1.143 2016/01/20 19:01:39 ratchov Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org> * @@ -1584,7 +1584,11 @@ audio_ioctl(struct audio_softc *sc, unsigned long cmd, void *addr) error = audio_getinfo(sc, (struct audio_info *)addr); break; case AUDIO_GETDEV: - error = sc->ops->getdev(sc->arg, (audio_device_t *)addr); + memset(addr, 0, sizeof(struct audio_device)); + if (sc->dev.dv_parent) + strlcpy(((struct audio_device *)addr)->name, + sc->dev.dv_parent->dv_xname, + MAX_AUDIO_DEV_LEN); break; case AUDIO_GETENC: error = sc->ops->query_encoding(sc->arg, |