From cccdce2d0550ff9d6f2f044dc07f9df43f39e5ec Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 24 Oct 2007 14:37:27 +0200 Subject: [PATCH] Simplify init_admissible_files(). It now takes an arg containing the mood or playlist to be initialized. --- afs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/afs.c b/afs.c index 9d235b35..2cbb010d 100644 --- a/afs.c +++ b/afs.c @@ -603,16 +603,10 @@ int com_select(int fd, int argc, char * const * const argv) return ret; } -static void init_admissible_files(void) +static void init_admissible_files(char *arg) { - int ret = 0; - char *arg = conf.afs_initial_mode_arg; - ret = activate_mood_or_playlist(arg, NULL); - if (ret >= 0) - return; - PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret)); - PARA_NOTICE_LOG("defaulting to dummy mood\n"); - activate_mood_or_playlist(NULL, NULL); /* always successful */ + if (activate_mood_or_playlist(arg, NULL) < 0) + activate_mood_or_playlist(NULL, NULL); /* always successful */ } static int setup_command_socket_or_die(void) @@ -966,7 +960,7 @@ __noreturn void afs_init(uint32_t cookie, int socket_fd) exit(EXIT_FAILURE); PARA_INFO_LOG("server_socket: %d, afs_socket_cookie: %u\n", server_socket, (unsigned) cookie); - init_admissible_files(); + init_admissible_files(conf.afs_initial_mode_arg); register_tasks(cookie); s.default_timeout.tv_sec = 0; s.default_timeout.tv_usec = 999 * 1000; -- 2.39.5