Fixed gcc warnings and added error handling to shell escape
authorClifford Wolf <clifford@clifford.at>
Fri, 15 Mar 2013 09:29:25 +0000 (10:29 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 15 Mar 2013 09:29:25 +0000 (10:29 +0100)
kernel/register.cc
passes/scc/scc.cc

index 5c9b40cd1772a17dae67fb1cdc99f159f355808b..ebb834c8f7a003e0c5c864c0dc292eb65e75f3fd 100644 (file)
@@ -142,7 +142,9 @@ void Pass::call(RTLIL::Design *design, std::string command)
                while (p >= s && (*p == '\r' || *p == '\n'))
                        *(p--) = 0;
                log_header("Shell command: %s\n", s);
-               system(s);
+               int retCode = system(s);
+               if (retCode != 0)
+                       log_cmd_error("Shell command returned error code %d.\n", retCode);
                return;
        }
        for (char *p = strtok_r(s, " \t\r\n", &saveptr); p; p = strtok_r(NULL, " \t\r\n", &saveptr)) {
index e665fd09e52da179ccb6fccfdad68440c4783e28..0dde3cbe8f046c21fadbfa95b543780981c71861 100644 (file)
@@ -73,6 +73,7 @@ struct SccWorker
                        }
 
                if (cellLabels[cell].first == cellLabels[cell].second)
+               {
                        if (cellStack.back() == cell)
                        {
                                cellStack.pop_back();
@@ -93,6 +94,7 @@ struct SccWorker
                                sccList.push_back(scc);
                                log("\n");
                        }
+               }
        }
 
        SccWorker(RTLIL::Design *design, RTLIL::Module *module, bool allCellTypes, int maxDepth) : design(design), module(module), sigmap(module)