From: Andre Date: Wed, 19 Apr 2006 03:22:14 +0000 (+0200) Subject: audioc.c, audiod.c, server.c: use para_fd_set() X-Git-Tag: v0.2.12~58 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=8f2cf66189cc863c3af702f78bb68596f2f3ef12;ds=sidebyside audioc.c, audiod.c, server.c: use para_fd_set() --- diff --git a/audioc.c b/audioc.c index b9e7853f..7d472a6d 100644 --- 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; diff --git a/audiod.c b/audiod.c index 912b2dbf..61711dc3 100644 --- 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) diff --git a/server.c b/server.c index e10c1e03..6f70d977 100644 --- 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++) {