]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fix changed error message handling
authorClemens Ladisch <clemens@ladisch.de>
Thu, 23 Dec 2004 08:15:46 +0000 (08:15 +0000)
committerClemens Ladisch <clemens@ladisch.de>
Thu, 23 Dec 2004 08:15:46 +0000 (08:15 +0000)
In the last error message handling change, some error conditions
didn't get properly inverted.

src/pcm/pcm.c

index 503e89a6d70a69e5f6c73ba5ea701fc5b7ce1ce8..4c17c3e81fca7bd74f3461411c5ebeb076de55db 100644 (file)
@@ -1312,7 +1312,7 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
                if (err < 0)
                        return err;
        }
-       if (pcm->poll_fd < 0) {
+       if (pcm->poll_fd < 0) {
                SNDMSG("poll_fd < 0");
                return -EIO;
        }
@@ -1907,7 +1907,7 @@ int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm,
  */
 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler)
 {
-       if (handler->type == SND_ASYNC_HANDLER_PCM) {
+       if (handler->type != SND_ASYNC_HANDLER_PCM) {
                SNDMSG("invalid handler type %d", handler->type);
                return NULL;
        }