chiark / gitweb /
Reverse the order of the shutdown() calls on the socketpair used to
[disorder] / server / disorderd.c
index e03e4d777dc665f994d3a5129f910edb031bc05f..913721bdecc87915a24943a755306c9e76004c5d 100644 (file)
@@ -57,6 +57,7 @@
 #include "mixer.h"
 #include "eventlog.h"
 #include "printf.h"
+#include "version.h"
 
 static ev_source *ev;
 
@@ -93,13 +94,6 @@ static void help(void) {
   exit(0);
 }
 
-/* display version number and terminate */
-static void version(void) {
-  xprintf("%s", disorder_version_string);
-  xfclose(stdout);
-  exit(0);
-}
-
 /* SIGHUP callback */
 static int handle_sighup(ev_source attribute((unused)) *ev_,
                         int attribute((unused)) sig,
@@ -217,7 +211,7 @@ int main(int argc, char **argv) {
   while((n = getopt_long(argc, argv, "hVc:dfP:Ns", options, 0)) >= 0) {
     switch(n) {
     case 'h': help();
-    case 'V': version();
+    case 'V': version("disorderd");
     case 'c': configfile = optarg; break;
     case 'd': debugging = 1; break;
     case 'f': background = 0; break;