X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=edd382711d0c058e41f7a731a38e8c47cab0883a;hp=be97516f1e66272cf53abde69122d80906d53159;hb=11ef83c4abb2ccbdf3f99a8adf98749b2b0656c2;hpb=6f5030f4b257aba7ea4265ef3ae35d96477bbfc3 diff --git a/server.c b/server.c index be97516f..edd38271 100644 --- a/server.c +++ b/server.c @@ -22,10 +22,12 @@ * * The gory details, listed by topic: * - * - Audio format handlers: \ref send_common.c \ref mp3_afh.c, \ref ogg_afh.c, \ref aac_afh.c, - * - Decoders: \ref mp3dec_filter.c, \ref oggdec_filter.c, \ref aacdec_filter.c, + * - Audio format handlers: \ref send_common.c \ref mp3_afh.c, + * \ref ogg_afh.c, \ref aac_afh.c, \ref wma_afh.c, + * - Decoders: \ref mp3dec_filter.c, \ref oggdec_filter.c, + * \ref aacdec_filter.c, \ref wmadec_filter.c, * - Volume normalizer: \ref compress_filter.c, - * - Output: \ref alsa_write.c, \ref osx_write.c, + * - Output: \ref alsa_write.c, \ref osx_write.c, \ref oss_write.c, * - http: \ref http_recv.c, \ref http_send.c, * - udp: \ref udp_recv.c, \ref udp_send.c, * - dccp: \ref dccp_recv.c, \ref dccp_send.c, @@ -57,7 +59,7 @@ * - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h, * - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c, * - Crypto: \ref crypt.c. - * - Forward error correction: \ref fec.c + * - Forward error correction: \ref fec.c. */ #include @@ -243,6 +245,8 @@ void parse_config_or_die(int override) daemon_set_flag(DF_LOG_PID); daemon_set_flag(DF_LOG_LL); daemon_set_flag(DF_LOG_TIME); + if (conf.log_timing_given) + daemon_set_flag(DF_LOG_TIMING); ret = 1; out: free(cf); @@ -439,19 +443,21 @@ err: static int init_afs(void) { int ret, afs_server_socket[2]; + pid_t afs_pid; ret = socketpair(PF_UNIX, SOCK_DGRAM, 0, afs_server_socket); if (ret < 0) exit(EXIT_FAILURE); get_random_bytes_or_die((unsigned char *)&afs_socket_cookie, sizeof(afs_socket_cookie)); - mmd->afs_pid = fork(); - if (mmd->afs_pid < 0) + afs_pid = fork(); + if (afs_pid < 0) exit(EXIT_FAILURE); - if (!mmd->afs_pid) { /* child (afs) */ + if (afs_pid == 0) { /* child (afs) */ close(afs_server_socket[0]); afs_init(afs_socket_cookie, afs_server_socket[1]); } + mmd->afs_pid = afs_pid; close(afs_server_socket[1]); ret = mark_fd_nonblocking(afs_server_socket[0]); if (ret < 0)