]> git.tue.mpg.de Git - paraslash.git/commitdiff
Simplify init_admissible_files().
authorAndre Noll <maan@systemlinux.org>
Wed, 24 Oct 2007 12:37:27 +0000 (14:37 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 24 Oct 2007 12:37:27 +0000 (14:37 +0200)
It now takes an arg containing the mood or playlist
to be initialized.

afs.c

diff --git a/afs.c b/afs.c
index 9d235b35bc9cd68d4c5d7b85ce24aa702cb2cd1b..2cbb010dcc8f7d9b35ab2c0ef45ac8a1f5ce7140 100644 (file)
--- 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;