Skip to content

Commit

Permalink
[fix] Do not try to kill the child if none was spawned
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 7, 2013
1 parent 586ea84 commit 75a449a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/forza.c
Expand Up @@ -23,7 +23,7 @@ static uv_pipe_t child_stdout;
static uv_pipe_t child_stderr;
static uv_pipe_t child_ipc;

static uv_process_t* child;
static uv_process_t* child = NULL;

static saneopt_t* opt;

Expand Down Expand Up @@ -167,8 +167,10 @@ void on_connect(int status) {
}

void forza__kill() {
printf("killing child...\n");
uv_process_kill(child, SIGKILL);
if (child != NULL) {
printf("killing child...\n");
uv_process_kill(child, SIGKILL);
}
}

void forza__on_sigterm() {
Expand Down

0 comments on commit 75a449a

Please sign in to comment.