* exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when continuing.
(stopped_or_terminated): Honor WCONTINUED. * wait.cc (wait4): Ditto. * include/cygwin/wait.h (WCONTINUED): Define. (__W_CONTINUED): Ditto. (WIFCONTINUED): Ditto.
This commit is contained in:
		| @@ -1,3 +1,13 @@ | ||||
| 2009-07-18  Christopher Faylor  <me+cygwin@cgf.cx> | ||||
|  | ||||
| 	* exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when | ||||
| 	continuing. | ||||
| 	(stopped_or_terminated): Honor WCONTINUED. | ||||
| 	* wait.cc (wait4): Ditto. | ||||
| 	* include/cygwin/wait.h (WCONTINUED): Define. | ||||
| 	(__W_CONTINUED): Ditto. | ||||
| 	(WIFCONTINUED): Ditto. | ||||
|  | ||||
| 2009-07-18  Dave Korn  <dave.korn.cygwin@gmail.com> | ||||
|  | ||||
| 	* libstdcxx_wrapper.cc (operator delete): Remove stray space in | ||||
|   | ||||
| @@ -760,6 +760,7 @@ sig_handle_tty_stop (int sig) | ||||
|     case WAIT_OBJECT_0: | ||||
|     case WAIT_OBJECT_0 + 1: | ||||
|       reset_signal_arrived (); | ||||
|       myself->stopsig = SIGCONT; | ||||
|       myself->alert_parent (SIGCONT); | ||||
|       break; | ||||
|     default: | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* cygwin/wait.h | ||||
|  | ||||
|    Copyright 2006 Red Hat, Inc. | ||||
|    Copyright 2006, 2009 Red Hat, Inc. | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| @@ -13,6 +13,8 @@ details. */ | ||||
|  | ||||
| #define WNOHANG 1 | ||||
| #define WUNTRACED 2 | ||||
| #define WCONTINUED 8 | ||||
| #define __W_CONTINUED	0xffff | ||||
|  | ||||
| /* A status looks like: | ||||
|       <2 bytes info> <2 bytes code> | ||||
| @@ -26,6 +28,7 @@ details. */ | ||||
| #define WIFEXITED(w)	(((w) & 0xff) == 0) | ||||
| #define WIFSIGNALED(w)	(((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) | ||||
| #define WIFSTOPPED(w)	(((w) & 0xff) == 0x7f) | ||||
| #define WIFCONTINUED(w)	(((w) & 0xffff) == __W_CONTINUED) | ||||
| #define WEXITSTATUS(w)	(((w) >> 8) & 0xff) | ||||
| #define WTERMSIG(w)	((w) & 0x7f) | ||||
| #define WSTOPSIG	WEXITSTATUS | ||||
|   | ||||
| @@ -1050,7 +1050,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child) | ||||
|   int terminated; | ||||
|  | ||||
|   if (!((terminated = (child->process_state == PID_EXITED)) || | ||||
|       ((w->options & WUNTRACED) && child->stopsig))) | ||||
|       ((w->options & (WUNTRACED | WCONTINUED)) && child->stopsig))) | ||||
|     return false; | ||||
|  | ||||
|   parent_w->next = w->next;	/* successful wait.  remove from wait queue */ | ||||
| @@ -1059,6 +1059,9 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child) | ||||
|   if (!terminated) | ||||
|     { | ||||
|       sigproc_printf ("stopped child"); | ||||
|       if (child->stopsig == SIGCONT) | ||||
| 	w->status = __W_CONTINUED; | ||||
|       else | ||||
| 	w->status = (child->stopsig << 8) | 0x7f; | ||||
|       child->stopsig = 0; | ||||
|     } | ||||
|   | ||||
| @@ -52,7 +52,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r) | ||||
|   while (1) | ||||
|     { | ||||
|       sig_dispatch_pending (); | ||||
|       if (options & ~(WNOHANG | WUNTRACED)) | ||||
|       if (options & ~(WNOHANG | WUNTRACED | WCONTINUED)) | ||||
| 	{ | ||||
| 	  set_errno (EINVAL); | ||||
| 	  res = -1; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user