Fixed for fcntl calls (NONBLOCK)...

This commit is contained in:
Jaroslav Kysela 1999-01-06 15:25:15 +00:00
parent dc6d1ffeb0
commit 54c4a6c610
5 changed files with 9 additions and 8 deletions

View File

@ -100,13 +100,13 @@ int snd_pcm_block_mode(void *handle, int enable)
pcm = (snd_pcm_t *) handle;
if (!pcm)
return -EINVAL;
if (fcntl(pcm->fd, F_GETFL, &flags) < 0)
if ((flags = fcntl(pcm->fd, F_GETFL)) < 0)
return -errno;
if (enable)
flags |= O_NONBLOCK;
else
flags &= ~O_NONBLOCK;
if (fcntl(pcm->fd, F_SETFL, &flags) < 0)
if (fcntl(pcm->fd, F_SETFL, flags) < 0)
return -errno;
return 0;
}

View File

@ -101,13 +101,13 @@ int snd_pcm_loopback_block_mode(void *handle, int enable)
lb = (snd_pcm_loopback_t *) handle;
if (!lb)
return -EINVAL;
if (fcntl(lb->fd, F_GETFL, &flags) < 0)
if ((flags = fcntl(lb->fd, F_GETFL)) < 0)
return -errno;
if (enable)
flags |= O_NONBLOCK;
else
flags &= ~O_NONBLOCK;
if (fcntl(lb->fd, F_SETFL, &flags) < 0)
if (fcntl(lb->fd, F_SETFL, flags) < 0)
return -errno;
return 0;
}

View File

@ -100,13 +100,13 @@ int snd_rawmidi_block_mode(void *handle, int enable)
rmidi = (snd_rawmidi_t *) handle;
if (!rmidi)
return -EINVAL;
if (fcntl(rmidi->fd, F_GETFL, &flags) < 0)
if ((flags = fcntl(rmidi->fd, F_GETFL)) < 0)
return -errno;
if (enable)
flags |= O_NONBLOCK;
else
flags &= ~O_NONBLOCK;
if (fcntl(rmidi->fd, F_SETFL, &flags) < 0)
if (fcntl(rmidi->fd, F_SETFL, flags) < 0)
return -errno;
return 0;
}

View File

@ -134,13 +134,13 @@ int snd_seq_block_mode(void *handle, int enable)
seq = (snd_seq_t *) handle;
if (!seq)
return -EINVAL;
if (fcntl(seq->fd, F_GETFL, &flags) < 0)
if ((flags = fcntl(seq->fd, F_GETFL)) < 0)
return -errno;
if (enable)
flags |= O_NONBLOCK;
else
flags &= ~O_NONBLOCK;
if (fcntl(seq->fd, F_SETFL, &flags) < 0)
if (fcntl(seq->fd, F_SETFL, flags) < 0)
return -errno;
return 0;
}

View File

@ -11,3 +11,4 @@ seq_LDADD=../src/libasound.la
INCLUDES=-I$(top_srcdir)/include
CFLAGS=-static -Wall -pipe -g
EXTRA_DIST=seq-decoder.c seq-sender.c