core file is now given from CrashDialog

Added run_program()
Added new splash image
New spawn_program() error codes
This commit is contained in:
Sanel Zukan
2007-08-07 11:54:57 +00:00
parent a80b5dcb2a
commit 25b80eaffa
9 changed files with 52 additions and 49 deletions

View File

@@ -35,8 +35,16 @@ void sigchld_handler(int sig) {
errno = 0;
pid = waitpid(WAIT_ANY, &status, WNOHANG);
if(global_watch != 0)
if(global_watch != 0) {
if(WIFEXITED(status))
status = WEXITSTATUS(status);
else if(WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
status = SPAWN_CHILD_CRASHED;
else
status = SPAWN_CHILD_KILLED;
global_watch(pid, status);
}
} while(pid <= 0 && errno == EINTR);
}
@@ -126,7 +134,7 @@ int spawn_program_with_core(const char* cmd, SignalWatch* wf, pid_t* child_pid_r
return ret;
}
int spawn_backtrace(const char* program, const char* core_path, const char* output, const char* script) {
int spawn_backtrace(const char* program, const char* core, const char* output, const char* script) {
const char* gdb_script = "bt\nquit\n";
const int gdb_script_len = 8;
@@ -158,11 +166,9 @@ int spawn_backtrace(const char* program, const char* core_path, const char* outp
argv[3] = "-x";
argv[4] = (char*)script;
argv[5] = (char*)program;
argv[6] = (char*)core_path;
argv[6] = (char*)core;
argv[7] = 0;
//printf("%s %s %s %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
execvp(argv[0], argv);
return -1;
} else {