]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Better handling of odd situations
authorAbramo Bagnara <abramo@alsa-project.org>
Fri, 14 Jul 2000 09:31:23 +0000 (09:31 +0000)
committerAbramo Bagnara <abramo@alsa-project.org>
Fri, 14 Jul 2000 09:31:23 +0000 (09:31 +0000)
src/pcm/plugin/mmap.c

index 5bfb2193a8346b3b12921c3446d2c70a2cb1361b..7b75aa8c3e4495cada642b0848d5b399463ab871 100644 (file)
@@ -76,7 +76,7 @@ static ssize_t mmap_src_channels(snd_pcm_plugin_t *plugin,
                ready = poll(&pfd, 1, 10000);
                if (ready < 0)
                        return ready;
-               if (ready && pfd.revents & POLLERR)
+               if (ready == 0 || (pfd.revents & POLLERR))
                        return -EPIPE;
                assert(snd_pcm_mmap_ready(stream));
        }
@@ -143,7 +143,7 @@ static ssize_t mmap_dst_channels(snd_pcm_plugin_t *plugin,
                ready = poll(&pfd, 1, 10000);
                if (ready < 0)
                        return ready;
-               if (ready && pfd.revents & POLLERR)
+               if (ready == 0 || (pfd.revents & POLLERR))
                        return -EPIPE;
                assert(snd_pcm_mmap_ready(stream));
        }