Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4c8975ad
Commit
4c8975ad
authored
May 21, 1993
by
Richard M. Stallman
Browse files
(wait_for_termination): Copy code from 18.59 (but sans BSD4_1 alternatives).
parent
02a76f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
9 deletions
+42
-9
src/sysdep.c
src/sysdep.c
+42
-9
No files found.
src/sysdep.c
View file @
4c8975ad
...
...
@@ -314,16 +314,49 @@ wait_for_termination (pid)
status
=
SYS
$
FORCEX
(
&
pid
,
0
,
0
);
break
;
#else
/* not VMS */
/* Exit if the process has terminated. */
if
(
!
synch_process_alive
)
#if defined (BSD) || (defined (HPUX) && !defined (HPUX_5))
/* Note that kill returns -1 even if the process is just a zombie now.
But inevitably a SIGCHLD interrupt should be generated
and child_sig will do wait3 and make the process go away. */
/* There is some indication that there is a bug involved with
termination of subprocesses, perhaps involving a kernel bug too,
but no idea what it is. Just as a hunch we signal SIGCHLD to see
if that causes the problem to go away or get worse. */
sigsetmask
(
sigmask
(
SIGCHLD
));
if
(
0
>
kill
(
pid
,
0
))
{
sigsetmask
(
SIGEMPTYMASK
);
kill
(
getpid
(),
SIGCHLD
);
break
;
}
if
(
wait_debugging
)
sleep
(
1
);
else
sigpause
(
SIGEMPTYMASK
);
#else
/* not BSD, and not HPUX version >= 6 */
#ifdef UNIPLUS
if
(
0
>
kill
(
pid
,
0
))
break
;
/* Otherwise wait 1 second or until a signal comes in. */
signal
(
SIGALRM
,
wait_for_termination_signal
);
alarm
(
1
);
pause
();
alarm
(
0
);
signal
(
SIGALRM
,
SIG_IGN
);
wait
(
0
);
#else
/* neither BSD nor UNIPLUS: random sysV */
#ifdef HAVE_SYSV_SIGPAUSE
sighold
(
SIGCHLD
);
if
(
0
>
kill
(
pid
,
0
))
{
sigrelse
(
SIGCHLD
);
break
;
}
sigpause
(
SIGCHLD
);
#else
/* not HAVE_SYSV_SIGPAUSE */
if
(
0
>
kill
(
pid
,
0
))
break
;
/* Using sleep instead of pause avoids timing error.
If the inferior dies just before the sleep,
we lose just one second. */
sleep
(
1
);
#endif
/* not HAVE_SYSV_SIGPAUSE */
#endif
/* not UNIPLUS */
#endif
/* not BSD, and not HPUX version >= 6 */
#endif
/* not VMS */
#else
/* not subprocesses */
#ifndef BSD4_1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment