]> git.alsa-project.org Git - alsa-gobject.git/commit
rawmidi: stream_pair: report error about write-only file descriptor
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 02:45:41 +0000 (11:45 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 02:45:41 +0000 (11:45 +0900)
commitf6d6c5381129d6990c1baad513d4806222d427ed
tree2130a7fe3ad66f2effed0fc020a1c95c999c5297
parentac34969c48f60765925e87042875b2179d94efe0
rawmidi: stream_pair: report error about write-only file descriptor

In design of ALSA rawmidi interface, one character device can handle
operations for both capture and playback. Applications can indicate
usage of both or either by flags of open system call.

The libalsarawmidi library checks the flag by fcntl(2) system call to
create GSource for capture. When the file descriptor is not configured
for read, the call returns error.

This commit handles the error for local error reporting.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/rawmidi/alsarawmidi-enum-types.h
src/rawmidi/stream-pair.c