X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audioc.c;h=7d472a6de5475c1eb524dab4bb3dacca64766301;hp=1fa9880210e96d8ca2509df78980453374a4e469;hb=ede4d4615c5a0e41a1dffc83ad78e9aabe1d57a3;hpb=a8a78f935dcefa8a7fcda8dae80bca64fe39d632 diff --git a/audioc.c b/audioc.c index 1fa98802..7d472a6d 100644 --- a/audioc.c +++ b/audioc.c @@ -51,7 +51,7 @@ static char *concat_args(const int argc, char * const *argv) static char *configfile_exists(void) { static char *config_file; - struct stat statbuf; + struct stat statbuf; if (!config_file) { @@ -59,7 +59,7 @@ static char *configfile_exists(void) config_file = make_message("%s/.paraslash/audioc.conf", home); free(home); } - if (!stat(config_file, &statbuf)) + if (!stat(config_file, &statbuf)) return config_file; return NULL; } @@ -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; @@ -137,7 +134,7 @@ int main(int argc, char *argv[]) goto out; } if (loaded < conf.bufsize_arg && FD_ISSET(fd, &rfd)) { - len = recv_bin_buffer(fd, buf + loaded, + len = recv_bin_buffer(fd, buf + loaded, conf.bufsize_arg - loaded); if (len <= 0) { ret = len < 0? -E_READ : 0;