]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
daemon: Improve daemon_log_welcome().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 15 Dec 2014 19:20:44 +0000 (20:20 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 22 Jul 2015 08:01:02 +0000 (10:01 +0200)
This function is used within para_server and para_audiod. Adding the
"para_" prefix in daemon_log_welcome() rather than its callers avoids
the duplication. Also rename the "whoami" parameter to "name" and add
documentation for it. Finally, the build date is not really important
in the log message, so simply remove it.

audiod.c
daemon.c
server.c

index 40443a612569988e00ade13c8f384a7090d133e3..accf0244f957809b9c55b7e56b61127492264d62 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
                exit(EXIT_FAILURE);
        }
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
                exit(EXIT_FAILURE);
        }
-       daemon_log_welcome("para_audiod");
+       daemon_log_welcome("audiod");
        daemon_set_start_time();
        set_initial_status();
        FOR_EACH_SLOT(i)
        daemon_set_start_time();
        set_initial_status();
        FOR_EACH_SLOT(i)
index ca74595695985ad866c6ad849cbc343e2801850a..94c4a8cba6b9aae8646491f3eeddfff016914c7b 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -249,11 +249,15 @@ void daemon_open_log_or_die(void)
 
 /**
  * Log the startup message containing the paraslash version.
 
 /**
  * Log the startup message containing the paraslash version.
+ *
+ * \param name The name of the executable.
+ *
+ * First the given \a name is prefixed with the string "para_". Next the git
+ * version is appended. The resulting string is logged with priority "INFO".
  */
  */
-void daemon_log_welcome(const char *whoami)
+void daemon_log_welcome(const char *name)
 {
 {
-       PARA_INFO_LOG("welcome to %s " PACKAGE_VERSION " ("BUILD_DATE")\n",
-               whoami);
+       PARA_INFO_LOG("welcome to para_%s-" PACKAGE_VERSION " \n", name);
 }
 
 /**
 }
 
 /**
index 9104c5aab356c798719ad55695c33d0f19d1e1f5..3118a3a0404c67b1663574125002f7ddf7cb87cc 100644 (file)
--- a/server.c
+++ b/server.c
@@ -466,7 +466,7 @@ static void server_init(int argc, char **argv)
        daemon_drop_privileges_or_die(conf.user_arg, conf.group_arg);
        /* parse config file, open log and set defaults */
        parse_config_or_die(0);
        daemon_drop_privileges_or_die(conf.user_arg, conf.group_arg);
        /* parse config file, open log and set defaults */
        parse_config_or_die(0);
-       daemon_log_welcome("para_server");
+       daemon_log_welcome("server");
        init_ipc_or_die(); /* init mmd struct and mmd->lock */
        daemon_set_start_time();
        init_user_list(user_list_file);
        init_ipc_or_die(); /* init mmd struct and mmd->lock */
        daemon_set_start_time();
        init_user_list(user_list_file);