From 66487f2895d0ddeedff61e4166274b5a27f15aa7 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 9 Sep 2012 22:57:42 +0200 Subject: [PATCH] Make waitpid(2) fail on signal arrival. --- sortix/process.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sortix/process.cpp b/sortix/process.cpp index 6593096b..2da1eb0b 100644 --- a/sortix/process.cpp +++ b/sortix/process.cpp @@ -357,8 +357,9 @@ namespace Sortix if ( options & WNOHANG ) return 0; zombiewaiting++; - kthread_cond_wait(&zombiecond, &childlock); + unsigned long r = kthread_cond_wait_signal(&zombiecond, &childlock); zombiewaiting--; + if ( !r ) { Error::Set(EINTR); return -1; } } if ( zombie->prevsibling )