lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 1ef40dd 06/14: Handle the exit code to avoid


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1ef40dd 06/14: Handle the exit code to avoid the unused result compilation warning
Date: Sat, 10 Oct 2020 11:07:12 -0400 (EDT)

branch: master
commit 1ef40ddc4fd957b6f66a6b7d1e8e1c56a8332a42
Author: Ilya Sinitsyn <isinitsyn@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Handle the exit code to avoid the unused result compilation warning
---
 main_cgi.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/main_cgi.cpp b/main_cgi.cpp
index 7ef87bf..dace41d 100644
--- a/main_cgi.cpp
+++ b/main_cgi.cpp
@@ -99,7 +99,12 @@ int try_main(int argc, char* argv[])
 
     if(argc == 2 && argv[1] == std::string("--capture"))
         {
-        std::system("set > settings");
+        int exit_code = std::system("set > settings");
+        if(EXIT_SUCCESS != exit_code)
+            {
+            std::cerr << "Failed to execute 'set' command;";
+            return EXIT_FAILURE;
+            }
         std::ofstream os("stdin.txt", ios_out_trunc_binary());
         os << std::cin.rdbuf();
         std::cout



reply via email to

[Prev in Thread] Current Thread [Next in Thread]