I wrote:
So now I suspect that the correct fix is to revert my patch, pull
the
NSIG setting code out of m/amdahl.h and s/usg5-4.h and put it into
syssignal.h, delete the #ifdef emacs ... #endif block in s/usg5-4.h, and
change all of the #include <signal.h> instances noted above to #include
"syssignal.h". Does that look correct?
I've had no feedback on this, so here's the patch I was talking about.
Upon closer inspection, a couple of the changes I mentioned above do not
look correct. Here's what I think should happen. This patch is against
current 21.5 CVS.
lib-src/ChangeLog addition:
2002-08-21 Jerry James <james(a)xemacs.org>
* gnuserv.h: Revert previous patch. Include syssignal.h instead
of signal.h.
* tcp.c: Include config.h, and substitute syssignal.h for
signal.h.
src/ChangeLog addition:
2002-08-21 Jerry James <james(a)xemacs.org>
* getloadavg.c: Substitute syssignal.h for signal.h.
* malloc.c: Ditto.
* unexhp9k3.c: Ditto.
* syssignal.h: Put NSIG setting code for SVR4 here.
* s/usg5-4.h: Don't include signal.h. Remove NSIG setting code,
since signal.h has not yet been included.
xemacs-21.5 source patch:
Diff command: cvs -q diff -uN
Files affected: src/s/usg5-4.h src/unexhp9k3.c src/syssignal.h src/malloc.c
src/getloadavg.c lib-src/tcp.c lib-src/gnuserv.h
Index: lib-src/gnuserv.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/gnuserv.h,v
retrieving revision 1.10
diff -d -u -u -r1.10 gnuserv.h
--- lib-src/gnuserv.h 2002/08/05 16:34:07 1.10
+++ lib-src/gnuserv.h 2002/08/21 21:25:04
@@ -39,15 +39,6 @@
#define PATCHLEVEL 2
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <errno.h>
-
#define NO_SHORTNAMES
/* gnuserv should not be compiled using SOCKS */
#define DO_NOT_SOCKSIFY
@@ -109,6 +100,15 @@
#endif /* BSD */
#endif /* No communication method pre-defined */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "syssignal.h"
+#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
Index: lib-src/tcp.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/tcp.c,v
retrieving revision 1.2
diff -d -u -u -r1.2 tcp.c
--- lib-src/tcp.c 2001/06/10 10:42:18 1.2
+++ lib-src/tcp.c 2002/08/21 21:25:04
@@ -32,6 +32,9 @@
* cc -O -o tcp tcp.c -DFUJITSU_UTS -lu -lsocket
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
@@ -51,7 +54,7 @@
#ifdef USG
#include <sys/stat.h>
-#include <signal.h>
+#include "syssignal.h"
#endif
#ifdef USG
Index: src/getloadavg.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/getloadavg.c,v
retrieving revision 1.16
diff -d -u -u -r1.16 getloadavg.c
--- src/getloadavg.c 2002/03/13 08:52:44 1.16
+++ src/getloadavg.c 2002/08/21 21:25:05
@@ -408,7 +408,7 @@
#ifdef UMAX
#include <stdio.h>
-#include <signal.h>
+#include "syssignal.h"
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/syscall.h>
Index: src/malloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/malloc.c,v
retrieving revision 1.8
diff -d -u -u -r1.8 malloc.c
--- src/malloc.c 2001/09/20 06:29:06 1.8
+++ src/malloc.c 2002/08/21 21:25:05
@@ -149,7 +149,7 @@
#else
/* Determine which kind of system this is. */
-#include <signal.h>
+#include "syssignal.h"
#ifndef SIGTSTP
#ifndef USG
#define USG
Index: src/syssignal.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syssignal.h,v
retrieving revision 1.13
diff -d -u -u -r1.13 syssignal.h
--- src/syssignal.h 2002/06/20 21:18:47 1.13
+++ src/syssignal.h 2002/08/21 21:25:05
@@ -251,7 +251,15 @@
#endif
#ifndef NSIG
-# define NSIG (SIGUSR2+1) /* guess how many elements are in sys_siglist... */
+# ifdef USG5_4
+/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
+ * instead, there's a system variable _sys_nsig. Unfortunately, we need the
+ * constant to dimension an array. So wire in the appropriate value here.
+ */
+# define NSIG 32
+# else
+# define NSIG (SIGUSR2+1) /* guess how many elements are in sys_siglist... */
+# endif
#endif
/* SYS_SIGLIST_DECLARED is determined by configure. On Linux, it seems,
Index: src/unexhp9k3.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexhp9k3.c,v
retrieving revision 1.4
diff -d -u -u -r1.4 unexhp9k3.c
--- src/unexhp9k3.c 2001/04/12 18:24:27 1.4
+++ src/unexhp9k3.c 2002/08/21 21:25:05
@@ -41,7 +41,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <signal.h>
+#include "syssignal.h"
#ifdef __hp9000s300
# include </usr/include/debug.h>
#endif
Index: src/s/usg5-4.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/s/usg5-4.h,v
retrieving revision 1.8
diff -d -u -u -r1.8 usg5-4.h
--- src/s/usg5-4.h 2001/06/10 10:42:39 1.8
+++ src/s/usg5-4.h 2002/08/21 21:25:06
@@ -79,21 +79,11 @@
#include <sys/filio.h>
#include <termio.h>
#include <sys/ttold.h>
-#include <signal.h>
#include <sys/stream.h>
#include <sys/termios.h>
#endif
#undef BROKEN_SIGIO
-
-/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
- * instead, there's a system variable _sys_nsig. Unfortunately, we need the
- * constant to dimension an array. So wire in the appropriate value here.
- */
-
-#ifndef NSIG
-#define NSIG 32
-#endif
/* We need bss_end from emacs.c for undumping */
--
Jerry James
http://www.ittc.ku.edu/~james/