X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod_command.c;h=56d922e6681e66d0d9c4f65df86569806a38ca80;hp=1ffab87c0fbd5269d6da52b05428dc44132dd922;hb=ba3cef172b3f905315c0279d0a664df4d1db149c;hpb=017aa6503f639c7d0bb7b7be200da5fde4f2f4bd diff --git a/audiod_command.c b/audiod_command.c index 1ffab87c..56d922e6 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Andre Noll + * Copyright (C) 2005-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -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;