]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
oss mixer: Improve error message.
authorAndre Noll <maan@systemlinux.org>
Mon, 6 May 2013 12:36:15 +0000 (14:36 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 6 May 2013 12:36:15 +0000 (14:36 +0200)
If /dev/mixer does not exist, para_fade fails with

main: No such file or directory

This is a rather bad error message, since the name of the missing file
is not mentioned. This patch makes oss_mix.c print the additional line

 oss_mix_open: could not open /dev/mixer

oss_mix.c

index 9fe865045a8e96006813d48b4dc0ff59164dd460..5182ad238b81f706ebac2f6abdcaec3859b809dc 100644 (file)
--- a/oss_mix.c
+++ b/oss_mix.c
@@ -56,8 +56,10 @@ static int oss_mix_open(const char *dev, struct mixer_handle **handle)
                dev = "/dev/mixer";
        PARA_INFO_LOG("opening %s\n", dev);
        ret = para_open(dev, O_RDWR, 42);
                dev = "/dev/mixer";
        PARA_INFO_LOG("opening %s\n", dev);
        ret = para_open(dev, O_RDWR, 42);
-       if (ret < 0)
+       if (ret < 0) {
+               PARA_ERROR_LOG("could not open %s\n", dev);
                return ret;
                return ret;
+       }
        h = para_malloc(sizeof(*h));
        h->fd = ret;
        *handle = h;
        h = para_malloc(sizeof(*h));
        h->fd = ret;
        *handle = h;