From 286d266fd0c2c6853131c62e77f8edab8f6dc2bb Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sat, 22 Oct 2016 11:46:28 +0000 Subject: [PATCH] PM: fix alarm signal delivery As of change git-87c599d, when processing CLOCK notifications, PM no longer set the current process pointer 'mp'. That pointer is however used when delivering signals through check_sig(), to see whether the current process may deliver a signal to the target process. As a result, delivering SIGALARM signals used a previous pointer in these checks, causing alarm signals not to be delivered in some cases. This patch ensures that alarm signals are again delivered with PM as current process. Change-Id: I94ccbe8b71289df0e1d6d67928e55297bbc28360 --- minix/servers/pm/alarm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/minix/servers/pm/alarm.c b/minix/servers/pm/alarm.c index e10f84dca..560a1b279 100644 --- a/minix/servers/pm/alarm.c +++ b/minix/servers/pm/alarm.c @@ -338,5 +338,7 @@ cause_sigalrm(int arg) set_alarm(rmp, rmp->mp_interval[ITIMER_REAL]); else rmp->mp_flags &= ~ALARM_ON; + mp = &mproc[0]; /* pretend the signal comes from PM */ + check_sig(rmp->mp_pid, SIGALRM, FALSE /* ksig */); } -- 2.44.0