Mixer load: don't upload empty mixers from non-existing files

This commit is contained in:
Julian Oes
2014-02-05 21:19:25 +01:00
parent 8a48a4916c
commit 3392086f8f
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -102,7 +102,8 @@ load(const char *devname, const char *fname)
if (ioctl(dev, MIXERIOCRESET, 0))
err(1, "can't reset mixers on %s", devname);
load_mixer_file(fname, &buf[0], sizeof(buf));
if (load_mixer_file(fname, &buf[0], sizeof(buf)) < 0)
err(1, "can't load mixer: %s", fname);
/* XXX pass the buffer to the device */
int ret = ioctl(dev, MIXERIOCLOADBUF, (unsigned long)buf);