kill -9 message

This commit is contained in:
Jack Halford 2016-12-12 11:12:53 +01:00
parent 83bde42e02
commit 0b3b3e2810

View file

@ -25,18 +25,17 @@ void sigchld_handler(int signo)
start = data_singleton()->jobc.list; start = data_singleton()->jobc.list;
pid = waitpid(-1, &status, WNOHANG); pid = waitpid(-1, &status, WNOHANG);
DG("SIGCHLD pid=%i", pid); DG("SIGCHLD pid=%i", pid);
/* start = NULL; */
list = start ? ft_lst_find(start, &pid, ft_cmppid) : NULL; list = start ? ft_lst_find(start, &pid, ft_cmppid) : NULL;
if (list) if (list)
{ {
job = list->content; job = list->content;
if (status == 0) if (status == 0)
ft_printf("[%i] + done\t%s\n", job->id, job->command); ft_printf("[%i] + %i done\t%s\n", job->id, pid, job->command);
else if (status == 9)
ft_printf("[%i] + %i killed\t%s\n", job->id, pid, job->command);
else else
ft_printf("[%i] + exit %i\t%s\n", job->id, status, job->command); ft_printf("[%i] + %i exit %i\t%s\n",
job->id, pid, status, job->command);
ft_prompt(); ft_prompt();
} }
else
DG("SIGCHLD but no find");
} }