]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - grab_client.c
new function: set_stream_fds()
[paraslash.git] / grab_client.c
index 2dfb295b8ce87fcb5f165bcfd4b3c25f3bdb5b50..6769ee522ef3dfcd7dac66fb0c299c4ee0e37ef7 100644 (file)
@@ -32,6 +32,7 @@
 #include "audiod.h"
 #include "error.h"
 #include "string.h"
+#include "fd.h"
 
 /** grab clients that are not yet attached to a filter node */
 struct list_head inactive_grab_client_list;
@@ -56,12 +57,10 @@ static int gc_write(char *buf, size_t len, struct filter_callback *fcb)
 
 //     PARA_INFO_LOG("writing %d bytes to fd %d\n", len, gc->fd);
        fd_set wfds;
-       do {
-               FD_ZERO(&wfds);
-               FD_SET(gc->fd, &wfds);
-               ret = select(gc->fd + 1, NULL, &wfds, NULL, &tv);
-       } while (ret == EAGAIN || ret == EINTR);
-       if (ret != 1) {
+       FD_ZERO(&wfds);
+       FD_SET(gc->fd, &wfds);
+       ret = para_select(gc->fd + 1, NULL, &wfds, &tv);
+       if (ret <= 0) {
                if (gc->mode == GRAB_PEDANTIC)
                        return -E_PEDANTIC_GRAB;
                if (gc->mode == GRAB_SLOPPY)