diff options
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index aebf6e7a2d1..08c2bd48e59 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -420,6 +420,10 @@ wait_for_termination (pid) | |||
| 420 | sigpause (SIGEMPTYMASK); | 420 | sigpause (SIGEMPTYMASK); |
| 421 | #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 421 | #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 422 | #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ | 422 | #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ |
| 423 | #ifdef WINDOWSNT | ||
| 424 | wait (0); | ||
| 425 | break; | ||
| 426 | #else /* not WINDOWSNT */ | ||
| 423 | sigblock (sigmask (SIGCHLD)); | 427 | sigblock (sigmask (SIGCHLD)); |
| 424 | errno = 0; | 428 | errno = 0; |
| 425 | if (kill (pid, 0) == -1 && errno == ESRCH) | 429 | if (kill (pid, 0) == -1 && errno == ESRCH) |
| @@ -429,6 +433,7 @@ wait_for_termination (pid) | |||
| 429 | } | 433 | } |
| 430 | 434 | ||
| 431 | sigsuspend (&empty_mask); | 435 | sigsuspend (&empty_mask); |
| 436 | #endif /* not WINDOWSNT */ | ||
| 432 | #else /* not POSIX_SIGNALS */ | 437 | #else /* not POSIX_SIGNALS */ |
| 433 | #ifdef HAVE_SYSV_SIGPAUSE | 438 | #ifdef HAVE_SYSV_SIGPAUSE |
| 434 | sighold (SIGCHLD); | 439 | sighold (SIGCHLD); |
| @@ -439,17 +444,12 @@ wait_for_termination (pid) | |||
| 439 | } | 444 | } |
| 440 | sigpause (SIGCHLD); | 445 | sigpause (SIGCHLD); |
| 441 | #else /* not HAVE_SYSV_SIGPAUSE */ | 446 | #else /* not HAVE_SYSV_SIGPAUSE */ |
| 442 | #ifdef WINDOWSNT | ||
| 443 | wait (0); | ||
| 444 | break; | ||
| 445 | #else /* not WINDOWSNT */ | ||
| 446 | if (0 > kill (pid, 0)) | 447 | if (0 > kill (pid, 0)) |
| 447 | break; | 448 | break; |
| 448 | /* Using sleep instead of pause avoids timing error. | 449 | /* Using sleep instead of pause avoids timing error. |
| 449 | If the inferior dies just before the sleep, | 450 | If the inferior dies just before the sleep, |
| 450 | we lose just one second. */ | 451 | we lose just one second. */ |
| 451 | sleep (1); | 452 | sleep (1); |
| 452 | #endif /* not WINDOWSNT */ | ||
| 453 | #endif /* not HAVE_SYSV_SIGPAUSE */ | 453 | #endif /* not HAVE_SYSV_SIGPAUSE */ |
| 454 | #endif /* not POSIX_SIGNALS */ | 454 | #endif /* not POSIX_SIGNALS */ |
| 455 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 455 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| @@ -2105,6 +2105,8 @@ read_input_waiting () | |||
| 2105 | 2105 | ||
| 2106 | sigset_t empty_mask, full_mask; | 2106 | sigset_t empty_mask, full_mask; |
| 2107 | 2107 | ||
| 2108 | #ifndef WINDOWSNT | ||
| 2109 | |||
| 2108 | signal_handler_t | 2110 | signal_handler_t |
| 2109 | sys_signal (int signal_number, signal_handler_t action) | 2111 | sys_signal (int signal_number, signal_handler_t action) |
| 2110 | { | 2112 | { |
| @@ -2133,6 +2135,8 @@ sys_signal (int signal_number, signal_handler_t action) | |||
| 2133 | return (old_action.sa_handler); | 2135 | return (old_action.sa_handler); |
| 2134 | } | 2136 | } |
| 2135 | 2137 | ||
| 2138 | #endif /* WINDOWSNT */ | ||
| 2139 | |||
| 2136 | #ifndef __GNUC__ | 2140 | #ifndef __GNUC__ |
| 2137 | /* If we're compiling with GCC, we don't need this function, since it | 2141 | /* If we're compiling with GCC, we don't need this function, since it |
| 2138 | can be written as a macro. */ | 2142 | can be written as a macro. */ |