]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
introduce mark_fd_nonblock()
[paraslash.git] / audiod.c
index 581cec154bb80493ae007b59a2d7b29d7b84c3dd..9708f4fa363f4ffa6d3540fc7cb27c79917f76ca 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -721,7 +721,7 @@ static void start_stream_writer(int slot_num)
        s->write_fd = fds[0];
        add_close_on_fork_list(s->write_fd);
        /* we write to this fd in do_select, so we need non-blocking */
-       fcntl(s->write_fd, F_SETFL, O_NONBLOCK);
+       mark_fd_nonblock(s->write_fd);
        gettimeofday(&s->wstime, NULL);
        current_decoder = slot_num;
        activate_inactive_grab_clients(slot_num, s->format, &s->fci->filters);
@@ -1604,14 +1604,11 @@ repeat:
        ret = audiod_pre_select(&rfds, &wfds, &tv);
        max_fileno = MAX(max_fileno, ret);
 
-       ret = select(max_fileno + 1, &rfds, &wfds, NULL, &tv);
-       if (ret < 0 && errno != EINTR)
-               PARA_ERROR_LOG("select returned %d (%s)\n", ret,
-                       strerror(errno));
-       if (audiod_status != AUDIOD_OFF)
-               audiod_status_dump();
+       ret = para_select(max_fileno + 1, &rfds, &wfds, &tv);
        if (ret < 0)
                goto repeat;
+       if (audiod_status != AUDIOD_OFF)
+               audiod_status_dump();
        audiod_post_select(ret, &rfds, &wfds);
        /* read status pipe */
        if (stat_pipe >=0 && FD_ISSET(stat_pipe, &rfds)) {