diff --git a/comfortable_swipe/service/restart.cpp b/comfortable_swipe/service/restart.cpp
index c632a4f..2804c23 100644
--- a/comfortable_swipe/service/restart.cpp
+++ b/comfortable_swipe/service/restart.cpp
@@ -20,9 +20,7 @@ along with this program. If not, see .
*/
-#include // popen, pclose
-#include // std::unique_ptr
-#include // std::system
+#include // freopen, stdout
#include "../all_headers.hpp"
namespace comfortable_swipe::service
@@ -32,10 +30,12 @@ namespace comfortable_swipe::service
*/
void restart()
{
- // stop, while redirecting stdout to pipe
- std::unique_ptr pipe(popen(__COMFORTABLE_SWIPE__PROGRAM__ " stop", "r"), pclose);
+ // dont show stdout on stop
+ freopen("/dev/null", "a", stdout);
+ comfortable_swipe::service::stop();
- // restart service
+ // show back on start
+ freopen ("/dev/tty", "a", stdout);
comfortable_swipe::service::start();
}
}