#ifndef prototype1_src_l1_system_creating_child_proc_h
#define prototype1_src_l1_system_creating_child_proc_h

#include "../core/util.h"

void calling_system_func_nofail(const char* command) {
    int ret = system(command);
    if (ret == -1) {
        abortf("system() failed\n");
    } else if (WIFEXITED(ret) && WEXITSTATUS(ret) != 0) {
        abortf("Error: command exited with code %d\n", WEXITSTATUS(ret));
    } else if (!WIFEXITED(ret)) {
        abortf("Error: command terminated abnormally\n");
    }
}


#endif