void-packages/srcpkgs/alsa-plugins/patches/fix-jack-blocking-pipe.patch

33 lines
672 B
Diff
Raw Normal View History

--- jack/pcm_jack.c.old 2011-11-05 00:39:14.238794519 -0600
+++ jack/pcm_jack.c 2011-11-05 00:43:07.936817855 -0600
@@ -307,6 +307,19 @@
return 0;
}
+static int make_nonblock(int fd)
+{
+ int fl;
+
+ if ((fl = fcntl(fd, F_GETFL)) < 0)
+ return fl;
+
+ if (fl & O_NONBLOCK)
+ return 0;
+
+ return fcntl(fd, F_SETFL, fl | O_NONBLOCK);
+}
+
static int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
snd_config_t *playback_conf,
snd_config_t *capture_conf,
@@ -363,6 +376,9 @@
socketpair(AF_LOCAL, SOCK_STREAM, 0, fd);
+ make_nonblock(fd[0]);
+ make_nonblock(fd[1]);
+
jack->fd = fd[0];
jack->io.version = SND_PCM_IOPLUG_VERSION;