* 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.
This commit is contained in:
Dan Nicolaescu 2008-07-12 05:31:23 +00:00
parent 2f4ec7ce4f
commit bba104c11e
14 changed files with 29 additions and 128 deletions

View file

@ -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

View file

@ -1,3 +1,7 @@
2008-07-12 Dan Nicolaescu <dann@ics.uci.edu>
* movemail.c (main): Use int instead of WAITTYPE.
2008-07-05 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (OTHER_PLATFORM_SUPPORT):

View file

@ -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

View file

@ -1,3 +1,22 @@
2008-07-12 Dan Nicolaescu <dann@ics.uci.edu>
* 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 <cyd@stupidchicken.com>
* indent.c (Fvertical_motion): Restore hscroll before moving to

View file

@ -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__ */

View file

@ -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. */

View file

@ -172,10 +172,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define POSIX_SIGNALS
#undef sigmask
/* Dave Love <d.love@dl.ac.uk> 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

View file

@ -59,10 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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

View file

@ -110,7 +110,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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

View file

@ -204,8 +204,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 */

View file

@ -64,10 +64,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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; })

View file

@ -33,8 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 <http://www.gnu.org/licenses/>. */
#define END_FILES_1
#endif
#define HAVE_WAIT_HEADER
#define WAIT_USE_INT
#define AMPERSAND_FULL_NAME
#ifdef __ELF__

View file

@ -82,11 +82,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 <http://www.gnu.org/licenses/>. */
#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 <http://www.gnu.org/licenses/>. */
#define UNEXEC unexelf.o
/* <sys/stat.h> *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 <sys/filio.h>. Get <sys/ttold.h> to get struct
* tchars. But get <termio.h> 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 <http://www.gnu.org/licenses/>. */
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)

View file

@ -26,11 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 <sys/types.h>
#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */
@ -59,79 +54,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 <sys/wait.h>
#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 <sys/wait.h>
#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)