Additional error messages
authorRafał Długołęcki <rafal@dlugolecki.net.pl>
Mon, 25 Jan 2016 01:32:45 +0000 (02:32 +0100)
committerRafał Długołęcki <rafal@dlugolecki.net.pl>
Mon, 25 Jan 2016 01:32:45 +0000 (02:32 +0100)
src/kernel/kernel.cpp

index 578498c4774bbb3a65c6482a1470efcb955d998e..dbe7359f70f52144984ead9eb6d0db03c4e99f4a 100644 (file)
@@ -192,7 +192,6 @@ void QKernel::loadConfig(const QString & fname)
  */
 void QKernel::loadConfig(const char * fname)
 {
-       fprintf(stderr, "2: %s\n", fname);
        config_t cfg;
        config_setting_t *setting;
 
@@ -324,6 +323,13 @@ void QKernel::on_actionEditor_triggered()
                        WriteMessage("Executing logedit failed!");
                }
        }
+       else if (pid < 0) {
+               WriteMessage("fork(logedit) failed!");
+               WriteMessage("Exiting...");
+               sleep(2);
+               on_actionQuit_triggered();
+               exit(3);
+       }
 }
 
 /**
@@ -352,6 +358,13 @@ void QKernel::on_actionHelp_triggered()
                        WriteMessage("Executing loghelp failed!");
                }
        }
+       else if (pid < 0) {
+               WriteMessage("fork(loghelp) failed!");
+               WriteMessage("Exiting...");
+               sleep(2);
+               on_actionQuit_triggered();
+               exit(3);
+       }
 }
 
 /**
@@ -363,6 +376,7 @@ void QKernel::RunGraphModule(char *sk)
 
        QString program = getHomeDir();
        program += "/modules/loggraph";
+
        pid_t pid = fork();
        if (pid == 0) {
                if (execl(program.toStdString().c_str(),