]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
audioc.c, audiod.c, server.c: use para_fd_set()
authorAndre <maan@p133.(none)>
Wed, 19 Apr 2006 03:22:14 +0000 (05:22 +0200)
committerAndre <maan@p133.(none)>
Wed, 19 Apr 2006 03:22:14 +0000 (05:22 +0200)
audioc.c
audiod.c
server.c

index b9e7853fcee803f6dee6b92cf8691aa06e8843ed..7d472a6de5475c1eb524dab4bb3dacca64766301 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -119,13 +119,10 @@ int main(int argc, char *argv[])
                FD_ZERO(&wfd);
                if (loaded && loaded > 10000)
                        fprintf(stderr, "loaded: %d\n", loaded);
-               if (loaded < conf.bufsize_arg) {
-                       FD_SET(fd, &rfd);
-                       max_fileno = PARA_MAX(max_fileno, fd);
-               }
+               if (loaded < conf.bufsize_arg)
+                       para_fd_set(fd, &rfd, &max_fileno);
                if (loaded > 0) {
-                       FD_SET(STDOUT_FILENO, &wfd);
-                       max_fileno = PARA_MAX(max_fileno, STDOUT_FILENO);
+                       para_fd_set(STDOUT_FILENO, &wfd, &max_fileno);
                        check_write = 1;
                }
                ret = -E_OVERRUN;
index 912b2dbf24343c83e48076e0c7d059f54797c125..61711dc3f5591d9396ebe62496871404834dea47 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1562,8 +1562,7 @@ repeat:
        FD_ZERO(&wfds);
        FD_ZERO(&rfds);
        /* always check signal pipe and the local socket */
-       FD_SET(signal_pipe, &rfds);
-       max_fileno = signal_pipe;
+       para_fd_set(signal_pipe, &rfds, &max_fileno);
        para_fd_set(audiod_socket, &rfds, &max_fileno);
 
        if (audiod_status != AUDIOD_ON)
index e10c1e0343c77f1462bb7117b38486f39161411f..6f70d977d0814e0c7fa5a54581baf405397ea259 100644 (file)
--- a/server.c
+++ b/server.c
@@ -63,6 +63,7 @@ extern void http_send_init(struct sender *);
 extern void ortp_send_init(struct sender *);
 extern struct audio_format afl[];
 
+/* TODO: This is better handled by autoconf */
 /** the list of supported audio file selectors */
 struct audio_file_selector selectors[] = {
        {
@@ -436,14 +437,12 @@ int main(int argc, char *argv[])
        valid_fd_012();
        sockfd = do_inits(argc, argv);
 repeat:
-       /* check socket and signal pipe in any case */
        FD_ZERO(&rfds);
        FD_ZERO(&wfds);
-       FD_SET(sockfd, &rfds);
-       max_fileno = sockfd;
-       FD_SET(signal_pipe, &rfds);
-       max_fileno = PARA_MAX(max_fileno, signal_pipe);
-
+       max_fileno = -1;
+       /* check socket and signal pipe in any case */
+       para_fd_set(sockfd, &rfds, &max_fileno);
+       para_fd_set(signal_pipe, &rfds, &max_fileno);
        timeout = afs_preselect();
        status_refresh();
        for (i = 0; senders[i].name; i++) {