From bba104c11e882cd9ea7c2c9ec4cf79b7f152d5ff Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 12 Jul 2008 05:31:23 +0000 Subject: * 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. --- src/process.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/process.c') 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. */ -- cgit v1.2.1