Skip to content

Commit

Permalink
signal: minor code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Bennett <steveb@workware.net.au>
  • Loading branch information
msteveb committed Jan 14, 2014
1 parent bbc6bf3 commit 8c7464c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions jim-signal.c
@@ -1,4 +1,3 @@

/*
* jim-signal.c
*
Expand Down Expand Up @@ -458,22 +457,22 @@ static int Jim_KillCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}

if (argc == 2) {
signame = "SIGTERM";
sig = SIGTERM;
pidObj = argv[1];
}
else {
signame = Jim_String(argv[1]);
pidObj = argv[2];
}

/* Special 'kill -0 pid' to determine if a pid exists */
if (strcmp(signame, "-0") == 0 || strcmp(signame, "0") == 0) {
sig = 0;
}
else {
sig = find_signal_by_name(interp, signame);
if (sig < 0) {
return JIM_ERR;
/* Special 'kill -0 pid' to determine if a pid exists */
if (strcmp(signame, "-0") == 0 || strcmp(signame, "0") == 0) {
sig = 0;
}
else {
sig = find_signal_by_name(interp, signame);
if (sig < 0) {
return JIM_ERR;
}
}
}

Expand Down

0 comments on commit 8c7464c

Please sign in to comment.