From 0b3b3e28103cc12ca17a0a9d0e52cfed47a54d0d Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 12 Dec 2016 11:12:53 +0100 Subject: [PATCH] kill -9 message --- 42sh/src/job-control/sigchld_handler.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/42sh/src/job-control/sigchld_handler.c b/42sh/src/job-control/sigchld_handler.c index 81d260c2..e72fc7b7 100644 --- a/42sh/src/job-control/sigchld_handler.c +++ b/42sh/src/job-control/sigchld_handler.c @@ -25,18 +25,17 @@ void sigchld_handler(int signo) start = data_singleton()->jobc.list; pid = waitpid(-1, &status, WNOHANG); DG("SIGCHLD pid=%i", pid); - /* start = NULL; */ list = start ? ft_lst_find(start, &pid, ft_cmppid) : NULL; if (list) { job = list->content; 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 - 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(); } - else - DG("SIGCHLD but no find"); - }