aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Nicolaescu2008-07-12 05:31:23 +0000
committerDan Nicolaescu2008-07-12 05:31:23 +0000
commitbba104c11e882cd9ea7c2c9ec4cf79b7f152d5ff (patch)
tree6cae6cf2406e44c00e2ae670a4555f741bdb01d4 /src
parent2f4ec7ce4fe0cb5036a919abdc101a611202ffd2 (diff)
downloademacs-bba104c11e882cd9ea7c2c9ec4cf79b7f152d5ff.tar.gz
emacs-bba104c11e882cd9ea7c2c9ec4cf79b7f152d5ff.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog19
-rw-r--r--src/m/mips.h1
-rw-r--r--src/process.c15
-rw-r--r--src/s/aix4-2.h4
-rw-r--r--src/s/bsd-common.h4
-rw-r--r--src/s/freebsd.h1
-rw-r--r--src/s/gnu-linux.h2
-rw-r--r--src/s/gnu.h4
-rw-r--r--src/s/netbsd.h5
-rw-r--r--src/s/usg5-4.h19
-rw-r--r--src/syswait.h73
11 files changed, 24 insertions, 123 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c1942a066be..56a471cc1f4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12008-07-12 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * syswait.h: Remove old if 0 code. Do not define WAITTYPE, it was
4 always defined as int.
5
6 * s/netbsd.h (HAVE_UNION_WAIT, HAVE_WAIT_HEADER, WAIT_USE_INT):
7 * s/gnu.h (HAVE_WAIT_HEADER, WAIT_USE_INT, HAVE_UNION_WAIT):
8 * s/gnu-linux.h (HAVE_WAIT_HEADER):
9 * s/freebsd.h (HAVE_WAIT_HEADER):
10 * s/bsd-common.h (HAVE_UNION_WAIT):
11 * s/aix4-2.h (HAVE_WAIT_HEADER):
12 * m/mips.h (HAVE_UNION_WAIT):
13 * s/usg5-4.h (HAVE_WAIT_HEADER, WAITTYPE): Do not define, not used.
14 (COFF, static): Do not define, they are undefined later in the file.
15
16 * process.c (update_status): Don't use a union.
17 (status_convert):
18 (sigchld_handler): Use int instead of WAITTYPE.
19
12008-07-12 Chong Yidong <cyd@stupidchicken.com> 202008-07-12 Chong Yidong <cyd@stupidchicken.com>
2 21
3 * indent.c (Fvertical_motion): Restore hscroll before moving to 22 * 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 */
198#define COFF 198#define COFF
199#define TERMINFO 199#define TERMINFO
200#undef MAIL_USE_FLOCK /* Someone should check this. */ 200#undef MAIL_USE_FLOCK /* Someone should check this. */
201#undef HAVE_UNION_WAIT
202#endif /* BSD_SYSTEM */ 201#endif /* BSD_SYSTEM */
203 202
204#endif /* not __linux__ */ 203#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];
407/* Compute the Lisp form of the process status, p->status, from 407/* Compute the Lisp form of the process status, p->status, from
408 the numeric status that was returned by `wait'. */ 408 the numeric status that was returned by `wait'. */
409 409
410static Lisp_Object status_convert (); 410static Lisp_Object status_convert (int);
411 411
412static void 412static void
413update_status (p) 413update_status (p)
414 struct Lisp_Process *p; 414 struct Lisp_Process *p;
415{ 415{
416 union { int i; WAITTYPE wt; } u;
417 eassert (p->raw_status_new); 416 eassert (p->raw_status_new);
418 u.i = p->raw_status; 417 p->status = status_convert (p->raw_status);
419 p->status = status_convert (u.wt);
420 p->raw_status_new = 0; 418 p->raw_status_new = 0;
421} 419}
422 420
@@ -424,8 +422,7 @@ update_status (p)
424 the list that we use internally. */ 422 the list that we use internally. */
425 423
426static Lisp_Object 424static Lisp_Object
427status_convert (w) 425status_convert (int w)
428 WAITTYPE w;
429{ 426{
430 if (WIFSTOPPED (w)) 427 if (WIFSTOPPED (w))
431 return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil)); 428 return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil));
@@ -6698,7 +6695,7 @@ sigchld_handler (signo)
6698 while (1) 6695 while (1)
6699 { 6696 {
6700 pid_t pid; 6697 pid_t pid;
6701 WAITTYPE w; 6698 int w;
6702 Lisp_Object tail; 6699 Lisp_Object tail;
6703 6700
6704#ifdef WNOHANG 6701#ifdef WNOHANG
@@ -6770,12 +6767,10 @@ sigchld_handler (signo)
6770 /* Change the status of the process that was found. */ 6767 /* Change the status of the process that was found. */
6771 if (p != 0) 6768 if (p != 0)
6772 { 6769 {
6773 union { int i; WAITTYPE wt; } u;
6774 int clear_desc_flag = 0; 6770 int clear_desc_flag = 0;
6775 6771
6776 p->tick = ++process_tick; 6772 p->tick = ++process_tick;
6777 u.wt = w; 6773 p->raw_status = w;
6778 p->raw_status = u.i;
6779 p->raw_status_new = 1; 6774 p->raw_status_new = 1;
6780 6775
6781 /* If process has terminated, stop waiting for its output. */ 6776 /* 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 <http://www.gnu.org/licenses/>. */
172#define POSIX_SIGNALS 172#define POSIX_SIGNALS
173#undef sigmask 173#undef sigmask
174 174
175/* Dave Love <d.love@dl.ac.uk> reported this as needed on AIX 4.1.
176 It is just a guess which versions of AIX need this definition. */
177#define HAVE_WAIT_HEADER
178
179/* olson@mcs.anl.gov says -li18n is needed by -lXm. */ 175/* olson@mcs.anl.gov says -li18n is needed by -lXm. */
180#define LIB_MOTIF -lXm -li18n 176#define LIB_MOTIF -lXm -li18n
181 177
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 <http://www.gnu.org/licenses/>. */
59 59
60#define HAVE_PTYS 60#define HAVE_PTYS
61 61
62/* Define this macro if system defines a type `union wait'. */
63
64#define HAVE_UNION_WAIT
65
66/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ 62/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
67 63
68#define HAVE_SOCKETS 64#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 <http://www.gnu.org/licenses/>. */
110 110
111#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_1 -L/usr/local/lib 111#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_1 -L/usr/local/lib
112 112
113#define HAVE_WAIT_HEADER
114#define HAVE_GETLOADAVG 1 113#define HAVE_GETLOADAVG 1
115#define HAVE_TERMIOS 114#define HAVE_TERMIOS
116#define NO_TERMIO 115#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 <http://www.gnu.org/licenses/>. */
204 204
205#define NO_SIOCTL_H /* don't have sioctl.h */ 205#define NO_SIOCTL_H /* don't have sioctl.h */
206 206
207#define HAVE_WAIT_HEADER
208
209#define SYSV_SYSTEM_DIR /* use dirent.h */ 207#define SYSV_SYSTEM_DIR /* use dirent.h */
210 208
211#define POSIX /* affects getpagesize.h and systty.h */ 209#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 <http://www.gnu.org/licenses/>. */
64#undef REL_ALLOC 64#undef REL_ALLOC
65#endif 65#endif
66 66
67#define HAVE_WAIT_HEADER
68#define WAIT_USE_INT
69#define HAVE_UNION_WAIT
70
71/* GNU needs its own crt0, and libc defines data_start. */ 67/* GNU needs its own crt0, and libc defines data_start. */
72#define ORDINARY_LINK 68#define ORDINARY_LINK
73#define DATA_START ({ extern int data_start; (char *) &data_start; }) 69#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 <http://www.gnu.org/licenses/>. */
33#undef LDAV_SYMBOL 33#undef LDAV_SYMBOL
34#define HAVE_GETLOADAVG 1 34#define HAVE_GETLOADAVG 1
35 35
36#define HAVE_UNION_WAIT
37
38#define SIGNALS_VIA_CHARACTERS 36#define SIGNALS_VIA_CHARACTERS
39 37
40#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) 38#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/>. */
92#define END_FILES_1 90#define END_FILES_1
93#endif 91#endif
94 92
95#define HAVE_WAIT_HEADER
96#define WAIT_USE_INT
97
98#define AMPERSAND_FULL_NAME 93#define AMPERSAND_FULL_NAME
99 94
100#ifdef __ELF__ 95#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 <http://www.gnu.org/licenses/>. */
82 82
83#define subprocesses 83#define subprocesses
84 84
85/* If your system uses COFF (Common Object File Format) then define the
86 preprocessor symbol "COFF". */
87
88#define COFF
89
90/* define MAIL_USE_FLOCK if the mailer uses flock 85/* define MAIL_USE_FLOCK if the mailer uses flock
91 to interlock access to /usr/spool/mail/$USER. 86 to interlock access to /usr/spool/mail/$USER.
92 The alternative is that a lock file named 87 The alternative is that a lock file named
@@ -137,12 +132,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
137#define rindex strrchr 132#define rindex strrchr
138#endif /* ! defined (HAVE_RINDEX) */ 133#endif /* ! defined (HAVE_RINDEX) */
139 134
140/* USG systems tend to put everything declared static
141 into the initialized data area, which becomes pure after dumping Emacs.
142 Foil this. Emacs carefully avoids static vars inside functions. */
143
144#define static
145
146/* Compiler bug bites on many systems when default ADDR_CORRECT is used. */ 135/* Compiler bug bites on many systems when default ADDR_CORRECT is used. */
147 136
148#define ADDR_CORRECT(x) (x) 137#define ADDR_CORRECT(x) (x)
@@ -185,12 +174,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
185 174
186#define UNEXEC unexelf.o 175#define UNEXEC unexelf.o
187 176
188/* <sys/stat.h> *defines* stat(2) as a static function. If "static"
189 * is blank, then many files will have a public definition for stat(2).
190 */
191
192#undef static
193
194/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct 177/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
195 * tchars. But get <termio.h> first to make sure ttold.h doesn't 178 * tchars. But get <termio.h> first to make sure ttold.h doesn't
196 * interfere. And don't try to use SIGIO yet. 179 * 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/>. */
229 without clearing the SIGCHLD pending info. So, use a non-blocking 212 without clearing the SIGCHLD pending info. So, use a non-blocking
230 wait3 instead, which maps to waitpid(2) in SysVr4. */ 213 wait3 instead, which maps to waitpid(2) in SysVr4. */
231 214
232#define HAVE_WAIT_HEADER
233#define WAITTYPE int
234#define wait3(status, options, rusage) \ 215#define wait3(status, options, rusage) \
235 waitpid ((pid_t) -1, (status), (options)) 216 waitpid ((pid_t) -1, (status), (options))
236#define WRETCODE(w) (w >> 8) 217#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 <http://www.gnu.org/licenses/>. */
26 26
27#ifndef VMS 27#ifndef VMS
28 28
29/* This is now really the approach recommended by Autoconf. If this
30 doesn't cause trouble anywhere, remove the original code, which is
31 #if'd out below. */
32
33#if 1
34#include <sys/types.h> 29#include <sys/types.h>
35 30
36#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ 31#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/>. */
59#define WTERMSIG(status) ((status) & 0x7f) 54#define WTERMSIG(status) ((status) & 0x7f)
60#endif 55#endif
61 56
62#undef WAITTYPE
63#define WAITTYPE int
64#undef WRETCODE 57#undef WRETCODE
65#define WRETCODE(status) WEXITSTATUS (status) 58#define WRETCODE(status) WEXITSTATUS (status)
66 59
67#else /* 0 */
68
69#ifndef WAITTYPE
70
71#ifdef WAIT_USE_INT
72/* Some systems have union wait in their header, but we should use
73 int regardless of that. */
74#include <sys/wait.h>
75#define WAITTYPE int
76#define WRETCODE(w) WEXITSTATUS (w)
77
78#else /* not WAIT_USE_INT */
79
80#if (!defined (BSD_SYSTEM) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER))
81#define WAITTYPE int
82#define WIFSTOPPED(w) ((w&0377) == 0177)
83#define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0)
84#define WIFEXITED(w) ((w&0377) == 0)
85#define WRETCODE(w) (w >> 8)
86#define WSTOPSIG(w) (w >> 8)
87#define WTERMSIG(w) (w & 0177)
88#ifndef WCOREDUMP
89#define WCOREDUMP(w) ((w&0200) != 0)
90#endif
91
92#else
93
94#include <sys/wait.h>
95
96#define WAITTYPE union wait
97#define WRETCODE(w) w.w_retcode
98#undef WCOREDUMP /* Later BSDs define this name differently. */
99#define WCOREDUMP(w) w.w_coredump
100
101#if defined (HPUX) || defined (convex)
102/* HPUX version 7 has broken definitions of these. */
103/* pvogel@convex.com says the convex does too. */
104#undef WTERMSIG
105#undef WSTOPSIG
106#undef WIFSTOPPED
107#undef WIFSIGNALED
108#undef WIFEXITED
109#endif /* HPUX | convex */
110
111#ifndef WTERMSIG
112#define WTERMSIG(w) w.w_termsig
113#endif
114#ifndef WSTOPSIG
115#define WSTOPSIG(w) w.w_stopsig
116#endif
117#ifndef WIFSTOPPED
118#define WIFSTOPPED(w) (WTERMSIG (w) == 0177)
119#endif
120#ifndef WIFSIGNALED
121#define WIFSIGNALED(w) (WTERMSIG (w) != 0177 && (WSTOPSIG (w)) == 0)
122#endif
123#ifndef WIFEXITED
124#define WIFEXITED(w) (WTERMSIG (w) == 0)
125#endif
126#endif /* BSD_SYSTEM || HPUX */
127#endif /* not WAIT_USE_INT */
128#endif /* no WAITTYPE */
129
130#endif /* 0 */
131
132#else /* VMS */ 60#else /* VMS */
133 61
134#define WAITTYPE int
135#define WIFSTOPPED(w) 0 62#define WIFSTOPPED(w) 0
136#define WIFSIGNALED(w) 0 63#define WIFSIGNALED(w) 0
137#define WIFEXITED(w) ((w) != -1) 64#define WIFEXITED(w) ((w) != -1)