Fixing command line daemon: properly starting non gui QT application
diff --git a/cmd/csd.cc b/cmd/csd.cc
index 2ad4d0d..3259e7a 100644
--- a/cmd/csd.cc
+++ b/cmd/csd.cc
@@ -18,6 +18,8 @@
  * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  */
 
+#include <QtCore>
+
 #include "dispatcher.h"
 #include "fs-watcher.h"
 #include "logging.h"
@@ -33,6 +35,8 @@
 {
   INIT_LOGGERS ();
 
+  QCoreApplication app(argc, argv);
+
   if (argc != 4)
     {
       cerr << "Usage: ./csd <username> <shared-folder> <path>" << endl;
@@ -51,10 +55,6 @@
                      bind (&Dispatcher::Did_LocalFile_AddOrModify, &dispatcher, _1),
                      bind (&Dispatcher::Did_LocalFile_Delete,      &dispatcher, _1));
 
-  while (true)
-    {
-      sleep (1);
-    }
 
-  return 0;
+  return app.exec ();
 }