diff --git a/comfortable_swipe/service/restart.cpp b/comfortable_swipe/service/restart.cpp
index 51c7495..c632a4f 100644
--- a/comfortable_swipe/service/restart.cpp
+++ b/comfortable_swipe/service/restart.cpp
@@ -19,6 +19,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
+
+#include // popen, pclose
+#include // std::unique_ptr
+#include // std::system
#include "../all_headers.hpp"
namespace comfortable_swipe::service
@@ -28,7 +32,10 @@ namespace comfortable_swipe::service
*/
void restart()
{
- comfortable_swipe::service::stop();
+ // stop, while redirecting stdout to pipe
+ std::unique_ptr pipe(popen(__COMFORTABLE_SWIPE__PROGRAM__ " stop", "r"), pclose);
+
+ // restart service
comfortable_swipe::service::start();
}
}
diff --git a/comfortable_swipe/service/stop.cpp b/comfortable_swipe/service/stop.cpp
index 6fb81af..5da375f 100644
--- a/comfortable_swipe/service/stop.cpp
+++ b/comfortable_swipe/service/stop.cpp
@@ -68,7 +68,7 @@ namespace comfortable_swipe::service
}
else
{
- std::puts("No program to stop");
+ std::printf("No program to stop\n");
}
}
}