[neon/neon/neon-boot-space/Neon/unstable] /: don't ignore return value

Harald Sitter null at kde.org
Thu Jun 17 12:17:44 BST 2021


Git commit f9a2900a518115110d57a4c23c9d9567a25aa799 by Harald Sitter.
Committed on 17/06/2021 at 11:17.
Pushed by sitter into branch 'Neon/unstable'.

don't ignore return value

to silence compiler warnings

if any of these commands fails we can't do anything about it anyway
though

M  +6    -2    main.cpp

https://invent.kde.org/neon/neon/neon-boot-space/commit/f9a2900a518115110d57a4c23c9d9567a25aa799

diff --git a/main.cpp b/main.cpp
index 61f3c2c..b6ef509 100644
--- a/main.cpp
+++ b/main.cpp
@@ -125,8 +125,12 @@ int main(int /*argc*/, char ** /*argv*/)
     }
 
     std::cout.flush();
-    std::system("systemctl daemon-reload");
-    std::system("systemctl isolate --no-block default.target");
+    if (std::system("systemctl daemon-reload") != 0) {
+        std::cerr << "daemon reload failed\n";
+    }
+    if (std::system("systemctl isolate --no-block default.target") != 0) {
+        std::cerr << "isolate failed\n";
+    }
 
     return 0;
 }



More information about the Neon-commits mailing list