From bba104c11e882cd9ea7c2c9ec4cf79b7f152d5ff Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 12 Jul 2008 05:31:23 +0000 Subject: [PATCH] * syswait.h: Remove old if 0 code. Do not define WAITTYPE, it was always defined as int. * s/netbsd.h (HAVE_UNION_WAIT, HAVE_WAIT_HEADER, WAIT_USE_INT): * s/gnu.h (HAVE_WAIT_HEADER, WAIT_USE_INT, HAVE_UNION_WAIT): * s/gnu-linux.h (HAVE_WAIT_HEADER): * s/freebsd.h (HAVE_WAIT_HEADER): * s/bsd-common.h (HAVE_UNION_WAIT): * s/aix4-2.h (HAVE_WAIT_HEADER): * m/mips.h (HAVE_UNION_WAIT): * s/usg5-4.h (HAVE_WAIT_HEADER, WAITTYPE): Do not define, not used. (COFF, static): Do not define, they are undefined later in the file. * process.c (update_status): Don't use a union. (status_convert): (sigchld_handler): Use int instead of WAITTYPE. * movemail.c (main): Use int instead of WAITTYPE. --- admin/CPP-DEFINES | 4 --- lib-src/ChangeLog | 4 +++ lib-src/movemail.c | 2 +- src/ChangeLog | 19 ++++++++++++++ src/m/mips.h | 1 - src/process.c | 15 ++++------- src/s/aix4-2.h | 4 --- src/s/bsd-common.h | 4 --- src/s/freebsd.h | 1 - src/s/gnu-linux.h | 2 -- src/s/gnu.h | 4 --- src/s/netbsd.h | 5 ---- src/s/usg5-4.h | 19 -------------- src/syswait.h | 73 ------------------------------------------------------ 14 files changed, 29 insertions(+), 128 deletions(-) diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 32c13f26f1d..be321e6dc60 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -200,12 +200,10 @@ HAVE_TEXT_START HAVE_TIMEVAL HAVE_TM_ZONE HAVE_TZSET -HAVE_UNION_WAIT HAVE_UNISTD_H HAVE_UTIMES HAVE_UTIME_H HAVE_VOLATILE -HAVE_WAIT_HEADER HAVE_WINDOW_SYSTEM HAVE_WORKING_VFORK HAVE_XRMSETDATABASE @@ -369,8 +367,6 @@ USG_SUBTTY_WORKS VALBITS VIRT_ADDR_VARIES VMS -WAITTYPE -WAIT_USE_INT WORDS_BIG_ENDIAN WRETCODE X11R5_INHIBIT_I18N diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 5a7f62f6821..6347c3a8e5a 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2008-07-12 Dan Nicolaescu + + * movemail.c (main): Use int instead of WAITTYPE. + 2008-07-05 Juanma Barranquero * makefile.w32-in (OTHER_PLATFORM_SUPPORT): diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 6d6a8b51882..7f9026d89c7 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -173,7 +173,7 @@ main (argc, argv) char *inname, *outname; int indesc, outdesc; int nread; - WAITTYPE status; + int status; int c, preserve_mail = 0; #ifndef MAIL_USE_SYSTEM_LOCK diff --git a/src/ChangeLog b/src/ChangeLog index c1942a066be..56a471cc1f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,22 @@ +2008-07-12 Dan Nicolaescu + + * syswait.h: Remove old if 0 code. Do not define WAITTYPE, it was + always defined as int. + + * s/netbsd.h (HAVE_UNION_WAIT, HAVE_WAIT_HEADER, WAIT_USE_INT): + * s/gnu.h (HAVE_WAIT_HEADER, WAIT_USE_INT, HAVE_UNION_WAIT): + * s/gnu-linux.h (HAVE_WAIT_HEADER): + * s/freebsd.h (HAVE_WAIT_HEADER): + * s/bsd-common.h (HAVE_UNION_WAIT): + * s/aix4-2.h (HAVE_WAIT_HEADER): + * m/mips.h (HAVE_UNION_WAIT): + * s/usg5-4.h (HAVE_WAIT_HEADER, WAITTYPE): Do not define, not used. + (COFF, static): Do not define, they are undefined later in the file. + + * process.c (update_status): Don't use a union. + (status_convert): + (sigchld_handler): Use int instead of WAITTYPE. + 2008-07-12 Chong Yidong * indent.c (Fvertical_motion): Restore hscroll before moving to diff --git a/src/m/mips.h b/src/m/mips.h index b446508b9af..ce0f56aa754 100644 --- a/src/m/mips.h +++ b/src/m/mips.h @@ -198,7 +198,6 @@ NOTE-END */ #define COFF #define TERMINFO #undef MAIL_USE_FLOCK /* Someone should check this. */ -#undef HAVE_UNION_WAIT #endif /* BSD_SYSTEM */ #endif /* not __linux__ */ diff --git a/src/process.c b/src/process.c index 0ddeb517290..c2a20b92db1 100644 --- a/src/process.c +++ b/src/process.c @@ -407,16 +407,14 @@ static char pty_name[24]; /* Compute the Lisp form of the process status, p->status, from the numeric status that was returned by `wait'. */ -static Lisp_Object status_convert (); +static Lisp_Object status_convert (int); static void update_status (p) struct Lisp_Process *p; { - union { int i; WAITTYPE wt; } u; eassert (p->raw_status_new); - u.i = p->raw_status; - p->status = status_convert (u.wt); + p->status = status_convert (p->raw_status); p->raw_status_new = 0; } @@ -424,8 +422,7 @@ update_status (p) the list that we use internally. */ static Lisp_Object -status_convert (w) - WAITTYPE w; +status_convert (int w) { if (WIFSTOPPED (w)) return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil)); @@ -6698,7 +6695,7 @@ sigchld_handler (signo) while (1) { pid_t pid; - WAITTYPE w; + int w; Lisp_Object tail; #ifdef WNOHANG @@ -6770,12 +6767,10 @@ sigchld_handler (signo) /* Change the status of the process that was found. */ if (p != 0) { - union { int i; WAITTYPE wt; } u; int clear_desc_flag = 0; p->tick = ++process_tick; - u.wt = w; - p->raw_status = u.i; + p->raw_status = w; p->raw_status_new = 1; /* If process has terminated, stop waiting for its output. */ diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index 9c075ead658..c435687bef1 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -172,10 +172,6 @@ along with GNU Emacs. If not, see . */ #define POSIX_SIGNALS #undef sigmask -/* Dave Love reported this as needed on AIX 4.1. - It is just a guess which versions of AIX need this definition. */ -#define HAVE_WAIT_HEADER - /* olson@mcs.anl.gov says -li18n is needed by -lXm. */ #define LIB_MOTIF -lXm -li18n diff --git a/src/s/bsd-common.h b/src/s/bsd-common.h index 2a94916eb19..d0d374c8410 100644 --- a/src/s/bsd-common.h +++ b/src/s/bsd-common.h @@ -59,10 +59,6 @@ along with GNU Emacs. If not, see . */ #define HAVE_PTYS -/* Define this macro if system defines a type `union wait'. */ - -#define HAVE_UNION_WAIT - /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ #define HAVE_SOCKETS diff --git a/src/s/freebsd.h b/src/s/freebsd.h index 779d944b6f6..aa7c21b59a5 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -110,7 +110,6 @@ along with GNU Emacs. If not, see . */ #define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_1 -L/usr/local/lib -#define HAVE_WAIT_HEADER #define HAVE_GETLOADAVG 1 #define HAVE_TERMIOS #define NO_TERMIO diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 39b9db496fc..4267da05d4e 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -204,8 +204,6 @@ along with GNU Emacs. If not, see . */ #define NO_SIOCTL_H /* don't have sioctl.h */ -#define HAVE_WAIT_HEADER - #define SYSV_SYSTEM_DIR /* use dirent.h */ #define POSIX /* affects getpagesize.h and systty.h */ diff --git a/src/s/gnu.h b/src/s/gnu.h index b5a839ec98a..857bf70a9cc 100644 --- a/src/s/gnu.h +++ b/src/s/gnu.h @@ -64,10 +64,6 @@ along with GNU Emacs. If not, see . */ #undef REL_ALLOC #endif -#define HAVE_WAIT_HEADER -#define WAIT_USE_INT -#define HAVE_UNION_WAIT - /* GNU needs its own crt0, and libc defines data_start. */ #define ORDINARY_LINK #define DATA_START ({ extern int data_start; (char *) &data_start; }) diff --git a/src/s/netbsd.h b/src/s/netbsd.h index 951e00091fc..5a667e30d2d 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h @@ -33,8 +33,6 @@ along with GNU Emacs. If not, see . */ #undef LDAV_SYMBOL #define HAVE_GETLOADAVG 1 -#define HAVE_UNION_WAIT - #define SIGNALS_VIA_CHARACTERS #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) @@ -92,9 +90,6 @@ along with GNU Emacs. If not, see . */ #define END_FILES_1 #endif -#define HAVE_WAIT_HEADER -#define WAIT_USE_INT - #define AMPERSAND_FULL_NAME #ifdef __ELF__ diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h index 84c357c02a2..2dac039c43b 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4.h @@ -82,11 +82,6 @@ along with GNU Emacs. If not, see . */ #define subprocesses -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ - -#define COFF - /* define MAIL_USE_FLOCK if the mailer uses flock to interlock access to /usr/spool/mail/$USER. The alternative is that a lock file named @@ -137,12 +132,6 @@ along with GNU Emacs. If not, see . */ #define rindex strrchr #endif /* ! defined (HAVE_RINDEX) */ -/* USG systems tend to put everything declared static - into the initialized data area, which becomes pure after dumping Emacs. - Foil this. Emacs carefully avoids static vars inside functions. */ - -#define static - /* Compiler bug bites on many systems when default ADDR_CORRECT is used. */ #define ADDR_CORRECT(x) (x) @@ -185,12 +174,6 @@ along with GNU Emacs. If not, see . */ #define UNEXEC unexelf.o -/* *defines* stat(2) as a static function. If "static" - * is blank, then many files will have a public definition for stat(2). - */ - -#undef static - /* Get FIONREAD from . Get to get struct * tchars. But get first to make sure ttold.h doesn't * interfere. And don't try to use SIGIO yet. @@ -229,8 +212,6 @@ along with GNU Emacs. If not, see . */ without clearing the SIGCHLD pending info. So, use a non-blocking wait3 instead, which maps to waitpid(2) in SysVr4. */ -#define HAVE_WAIT_HEADER -#define WAITTYPE int #define wait3(status, options, rusage) \ waitpid ((pid_t) -1, (status), (options)) #define WRETCODE(w) (w >> 8) diff --git a/src/syswait.h b/src/syswait.h index 8079737343c..d5ba3b968a5 100644 --- a/src/syswait.h +++ b/src/syswait.h @@ -26,11 +26,6 @@ along with GNU Emacs. If not, see . */ #ifndef VMS -/* This is now really the approach recommended by Autoconf. If this - doesn't cause trouble anywhere, remove the original code, which is - #if'd out below. */ - -#if 1 #include #ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ @@ -59,79 +54,11 @@ along with GNU Emacs. If not, see . */ #define WTERMSIG(status) ((status) & 0x7f) #endif -#undef WAITTYPE -#define WAITTYPE int #undef WRETCODE #define WRETCODE(status) WEXITSTATUS (status) -#else /* 0 */ - -#ifndef WAITTYPE - -#ifdef WAIT_USE_INT -/* Some systems have union wait in their header, but we should use - int regardless of that. */ -#include -#define WAITTYPE int -#define WRETCODE(w) WEXITSTATUS (w) - -#else /* not WAIT_USE_INT */ - -#if (!defined (BSD_SYSTEM) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER)) -#define WAITTYPE int -#define WIFSTOPPED(w) ((w&0377) == 0177) -#define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0) -#define WIFEXITED(w) ((w&0377) == 0) -#define WRETCODE(w) (w >> 8) -#define WSTOPSIG(w) (w >> 8) -#define WTERMSIG(w) (w & 0177) -#ifndef WCOREDUMP -#define WCOREDUMP(w) ((w&0200) != 0) -#endif - -#else - -#include - -#define WAITTYPE union wait -#define WRETCODE(w) w.w_retcode -#undef WCOREDUMP /* Later BSDs define this name differently. */ -#define WCOREDUMP(w) w.w_coredump - -#if defined (HPUX) || defined (convex) -/* HPUX version 7 has broken definitions of these. */ -/* pvogel@convex.com says the convex does too. */ -#undef WTERMSIG -#undef WSTOPSIG -#undef WIFSTOPPED -#undef WIFSIGNALED -#undef WIFEXITED -#endif /* HPUX | convex */ - -#ifndef WTERMSIG -#define WTERMSIG(w) w.w_termsig -#endif -#ifndef WSTOPSIG -#define WSTOPSIG(w) w.w_stopsig -#endif -#ifndef WIFSTOPPED -#define WIFSTOPPED(w) (WTERMSIG (w) == 0177) -#endif -#ifndef WIFSIGNALED -#define WIFSIGNALED(w) (WTERMSIG (w) != 0177 && (WSTOPSIG (w)) == 0) -#endif -#ifndef WIFEXITED -#define WIFEXITED(w) (WTERMSIG (w) == 0) -#endif -#endif /* BSD_SYSTEM || HPUX */ -#endif /* not WAIT_USE_INT */ -#endif /* no WAITTYPE */ - -#endif /* 0 */ - #else /* VMS */ -#define WAITTYPE int #define WIFSTOPPED(w) 0 #define WIFSIGNALED(w) 0 #define WIFEXITED(w) ((w) != -1) -- 2.11.4.GIT