From 5bb0a96329b926f5a31a2920afd4922c6cb5d836 Mon Sep 17 00:00:00 2001 From: ANUKOOL324 <145652634+ANUKOOL324@users.noreply.github.com> Date: Fri, 5 Jan 2024 20:06:45 +0530 Subject: [PATCH] Update signals.c The arguments for kill should be in the order (PID, SIGNAL), but it appears to be used as (SIGNAL, PID). This change ensures that the signal is sent to the process with the ID( f_current.pid). Using the correct order of arguments is important for the proper functioning of the kill function. --- signals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/signals.c b/signals.c index 02dbbed..c139089 100644 --- a/signals.c +++ b/signals.c @@ -28,7 +28,7 @@ void stphandler(int sig_num) return; if (f_current.pid != -1) { - kill(SIGTTIN, f_current.pid); + kill(f_current.pid, SIGTTIN); signal(SIGTSTP, stphandler); bg_jobs[num_job].pid = f_current.pid; strcpy(bg_jobs[num_job].name, f_current.name); @@ -42,4 +42,4 @@ void stphandler(int sig_num) prompt(); fflush(stdout); return; -} \ No newline at end of file +}