]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod_command.c
Merge branch 't/daemon_cleanups'
[paraslash.git] / audiod_command.c
index e65f747a50625b99fd3c06c69c62f30d475ddbac..7d284dc770eab6aef83a9e7d4fe5c74d241b7d47 100644 (file)
@@ -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;