X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audiod_command.c;h=7d284dc770eab6aef83a9e7d4fe5c74d241b7d47;hb=b0d2b25210ac347ab95dfa176d133f6629f0b123;hp=4485d9e9df28ca0fb2d1689046c1e53cffc9f5a5;hpb=72e9bdf7c5c09ca4c20cad56c68a9a155cceff43;p=paraslash.git diff --git a/audiod_command.c b/audiod_command.c index 4485d9e9..7d284dc7 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -29,6 +29,7 @@ #include "string.h" #include "write.h" #include "fd.h" +#include "version.h" #include "audiod_command_list.h" extern struct sched sched; @@ -419,6 +420,22 @@ static int com_cycle(int fd, int argc, char **argv) return 1; } +static int com_version(int fd, int argc, char **argv) +{ + int ret; + char *msg; + + if (argc > 1 && strcmp(argv[1], "-v") == 0) + msg = make_message("%s", version_text("audiod")); + else + msg = make_message("%s\n", version_single_line("audiod")); + ret = client_write(fd, msg); + free(msg); + if (ret >= 0) + close(fd); + return ret; +} + static int check_perms(uid_t uid) { int i; @@ -510,7 +527,7 @@ void audiod_status_dump(bool force) free(new); } - new = get_server_uptime_str(now); + new = daemon_get_uptime_str(now); old = stat_item_values[SI_AUDIOD_UPTIME]; if (force || !old || strcmp(old, new)) { free(old);