X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod_command.c;h=56d922e6681e66d0d9c4f65df86569806a38ca80;hp=4485d9e9df28ca0fb2d1689046c1e53cffc9f5a5;hb=ba3cef172b3f905315c0279d0a664df4d1db149c;hpb=42ddd68159d7eff0f3e7c225665c97f9abd59425 diff --git a/audiod_command.c b/audiod_command.c index 4485d9e9..56d922e6 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;