README: document nit_env.sh
[nit.git] / c_src / exec_nit.c
index 317e909..93f5f9b 100644 (file)
@@ -142,3 +142,12 @@ void exec_NativeProcess_NativeProcess_wait_0(void*d) {
                data->running = 0;
        }
 }
+
+int string_NativeString_NativeString_system_0(const char *cmd) {
+       int status = system(cmd);
+       if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) {
+               // cmd exited on SIGINT: in my opinion the user wants the main to be discontinued
+               kill(getpid(), SIGINT);
+       }
+       return status;
+}