Port to Solaris 8.

Without this change, 'configure' fails because the recently-added
wait3 prototype in config.h messes up later 'configure' tests.
Fix this problem by droping wait3 and WRETCODE, as they're
no longer needed on hosts that are current porting targets.
* configure.ac (wait3, WRETCODE): Remove, fixing a FIXME.
All uses changed to waitpid and WEXITSTATUS.
* src/syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
This commit is contained in:
Paul Eggert 2012-08-01 21:14:48 -07:00
parent 90df0db330
commit 13294f9517
10 changed files with 29 additions and 34 deletions

View file

@ -1,5 +1,13 @@
2012-08-02 Paul Eggert <eggert@cs.ucla.edu> 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
Port to Solaris 8.
Without this change, 'configure' fails because the recently-added
wait3 prototype in config.h messes up later 'configure' tests.
Fix this problem by droping wait3 and WRETCODE, as they're
no longer needed on hosts that are current porting targets.
* configure.ac (wait3, WRETCODE): Remove, fixing a FIXME.
All uses changed to waitpid and WEXITSTATUS.
Avoid needless autoheader after autogen.sh. Avoid needless autoheader after autogen.sh.
* src/stamp-h.in: Remove from bzr repository; no longer needed there. * src/stamp-h.in: Remove from bzr repository; no longer needed there.
* .bzrignore: Add it. * .bzrignore: Add it.

View file

@ -227,7 +227,6 @@ USG
USG5 USG5
USG_SUBTTY_WORKS USG_SUBTTY_WORKS
VALBITS VALBITS
WRETCODE
XOS_NEEDS_TIME_H XOS_NEEDS_TIME_H
_AIX _AIX
_ARCH_PPC64 _ARCH_PPC64

View file

@ -1,3 +1,8 @@
2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
Port to Solaris 8.
* CPP-DEFINES (WRETCODE): Remove.
2012-08-01 Dmitry Antipov <dmantipov@yandex.ru> 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
* coccinelle/overlay.cocci: Semantic patch to replace direct * coccinelle/overlay.cocci: Semantic patch to replace direct

View file

@ -3692,23 +3692,6 @@ case $opsys in
;; ;;
esac esac
dnl Used in process.c.
case $opsys in
irix6-5 | sol2* | unixware )
dnl It is possible to receive SIGCHLD when there are no children
dnl waiting, because a previous waitsys(2) cleaned up the carcass
dnl of child without clearing the SIGCHLD pending info. So, use a
dnl non-blocking wait3 instead, which maps to waitpid(2) in SysVr4.
AC_DEFINE(wait3(status, options, rusage),
[waitpid ((pid_t) -1, (status), (options))],
[Some platforms redefine this.])
dnl FIXME this makes no sense, because WRETCODE is only used in
dnl process.c, which includes syswait.h aftet config.h, and the
dnl former unconditionally redefines WRETCODE.
AC_DEFINE(WRETCODE(w), [(w >> 8)], [Some platforms redefine this.])
;;
esac
case $opsys in case $opsys in
hpux* | sol2* ) hpux* | sol2* )

View file

@ -560,8 +560,8 @@ main (int argc, char **argv)
wait (&wait_status); wait (&wait_status);
if (!WIFEXITED (wait_status)) if (!WIFEXITED (wait_status))
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
else if (WRETCODE (wait_status) != 0) else if (WEXITSTATUS (wait_status) != 0)
exit (WRETCODE (wait_status)); exit (WEXITSTATUS (wait_status));
#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK) #if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK)
#ifdef MAIL_USE_MAILLOCK #ifdef MAIL_USE_MAILLOCK

View file

@ -1,3 +1,8 @@
2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
Port to Solaris 8.
* syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2012-08-02 Glenn Morris <rgm@gnu.org> 2012-08-02 Glenn Morris <rgm@gnu.org>
* nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than

View file

@ -441,7 +441,7 @@ status_convert (int w)
if (WIFSTOPPED (w)) if (WIFSTOPPED (w))
return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil)); return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil));
else if (WIFEXITED (w)) else if (WIFEXITED (w))
return Fcons (Qexit, Fcons (make_number (WRETCODE (w)), return Fcons (Qexit, Fcons (make_number (WEXITSTATUS (w)),
WCOREDUMP (w) ? Qt : Qnil)); WCOREDUMP (w) ? Qt : Qnil));
else if (WIFSIGNALED (w)) else if (WIFSIGNALED (w))
return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w)), return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w)),
@ -4287,7 +4287,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
FD_ZERO (&Writeok); FD_ZERO (&Writeok);
if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit)
&& !(CONSP (PVAR (wait_proc, status)) && !(CONSP (PVAR (wait_proc, status))
&& EQ (XCAR (PVAR (wait_proc, status)), Qexit))) && EQ (XCAR (PVAR (wait_proc, status)), Qexit)))
message ("Blocking call to accept-process-output with quit inhibited!!"); message ("Blocking call to accept-process-output with quit inhibited!!");
@ -4887,7 +4887,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
if (p->pid == -2) if (p->pid == -2)
{ {
/* If the EIO occurs on a pty, sigchld_handler's /* If the EIO occurs on a pty, sigchld_handler's
wait3() will not find the process object to waitpid() will not find the process object to
delete. Do it here. */ delete. Do it here. */
p->tick = ++process_tick; p->tick = ++process_tick;
PVAR (p, status) = Qfailed; PVAR (p, status) = Qfailed;
@ -4959,7 +4959,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
if (xerrno) if (xerrno)
{ {
p->tick = ++process_tick; p->tick = ++process_tick;
PVAR (p, status) PVAR (p, status)
= Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
deactivate_process (proc); deactivate_process (proc);
} }
@ -6352,7 +6352,7 @@ sigchld_handler (int signo)
do do
{ {
errno = 0; errno = 0;
pid = wait3 (&w, WNOHANG | WUNTRACED, 0); pid = waitpid (-1, &w, WNOHANG | WUNTRACED);
} }
while (pid < 0 && errno == EINTR); while (pid < 0 && errno == EINTR);
@ -6440,7 +6440,7 @@ sigchld_handler (int signo)
/* Report the status of the synchronous process. */ /* Report the status of the synchronous process. */
if (WIFEXITED (w)) if (WIFEXITED (w))
synch_process_retcode = WRETCODE (w); synch_process_retcode = WEXITSTATUS (w);
else if (WIFSIGNALED (w)) else if (WIFSIGNALED (w))
synch_process_termsig = WTERMSIG (w); synch_process_termsig = WTERMSIG (w);
@ -6746,7 +6746,7 @@ suppressed. */)
CHECK_PROCESS (process); CHECK_PROCESS (process);
p = XPROCESS (process); p = XPROCESS (process);
if (NILP (flag)) if (NILP (flag))
PVAR (p, decode_coding_system) PVAR (p, decode_coding_system)
= raw_text_coding_system (PVAR (p, decode_coding_system)); = raw_text_coding_system (PVAR (p, decode_coding_system));
setup_process_coding_systems (process); setup_process_coding_systems (process);

View file

@ -294,7 +294,7 @@ wait_for_termination_1 (pid_t pid, int interruptible)
#if (defined (BSD_SYSTEM) || defined (HPUX)) && !defined (__GNU__) #if (defined (BSD_SYSTEM) || defined (HPUX)) && !defined (__GNU__)
/* Note that kill returns -1 even if the process is just a zombie now. /* Note that kill returns -1 even if the process is just a zombie now.
But inevitably a SIGCHLD interrupt should be generated But inevitably a SIGCHLD interrupt should be generated
and child_sig will do wait3 and make the process go away. */ and child_sig will do waitpid and make the process go away. */
/* There is some indication that there is a bug involved with /* There is some indication that there is a bug involved with
termination of subprocesses, perhaps involving a kernel bug too, termination of subprocesses, perhaps involving a kernel bug too,
but no idea what it is. Just as a hunch we signal SIGCHLD to see but no idea what it is. Just as a hunch we signal SIGCHLD to see

View file

@ -51,9 +51,4 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define WTERMSIG(status) ((status) & 0x7f) #define WTERMSIG(status) ((status) & 0x7f)
#endif #endif
#undef WRETCODE
#define WRETCODE(status) WEXITSTATUS (status)
#endif /* EMACS_SYSWAIT_H */ #endif /* EMACS_SYSWAIT_H */

View file

@ -549,7 +549,7 @@ sys_wait (int *status)
/* Report the status of the synchronous process. */ /* Report the status of the synchronous process. */
if (WIFEXITED (retval)) if (WIFEXITED (retval))
synch_process_retcode = WRETCODE (retval); synch_process_retcode = WEXITSTATUS (retval);
else if (WIFSIGNALED (retval)) else if (WIFSIGNALED (retval))
{ {
int code = WTERMSIG (retval); int code = WTERMSIG (retval);