fix trivial compiler warning in net.c
[paraslash.git] / server.c
index bcb43a20e610d275294447b4fc4728f8caaece78..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 = 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++) {
@@ -458,7 +457,7 @@ repeat:
        }
        if (selectors[mmd->selector_num].pre_select) {
                ret = selectors[mmd->selector_num].pre_select(&rfds, &wfds);
-               max_fileno = MAX(max_fileno, ret);
+               max_fileno = PARA_MAX(max_fileno, ret);
        }
        mmd_unlock();
        ret = para_select(max_fileno + 1, &rfds, &wfds, timeout);