From ede284de5fccecbde8a2b0b70471eec4cc5cd3eb Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 23 Dec 2005 01:24:14 +0000 Subject: * fork.cc (fork): Honor error return from sig_send. Don't continue with fork if we couldn't suspend signals. * sigproc.cc (sig_send): Set sigCONT event when we see __SIGNOHOLD. (wait_sig): Remove holding_signals. Create pipe with a buffer which will theoretically cause blocking if there is nothing reading on the pipe. Wait for sigCONT at end of loop when we have a __SIGHOLD. --- winsup/cygwin/fork.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fork.cc') diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 98ef42769..31a5820df 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -507,7 +507,14 @@ fork () return -1; } - sig_send (NULL, __SIGHOLD); + if (sig_send (NULL, __SIGHOLD)) + { + if (exit_state) + Sleep (INFINITE); + set_errno (EAGAIN); + return -1; + } + ischild = setjmp (grouped.ch.jmp); void *esp; -- cgit v1.2.3