Hi!

gzip fails to compile on mingw32 ("./configure --host i586-mingw32msvc
&& make") due to undefined SIGPIPE.  I noticed that there's already code
to prevent this problem, but it isn't placed before any use of this macro,
and hence not (currently) effective.

See attached patch.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
diff -urp gzip-1.3.12/gzip.c gzip-1.3.12.new/gzip.c
--- gzip-1.3.12/gzip.c	2007-03-20 06:09:51.000000000 +0100
+++ gzip-1.3.12.new/gzip.c	2007-11-22 16:52:52.000000000 +0100
@@ -211,6 +211,30 @@ size_t z_len;         /* strlen(z_suffix
 /* The set of signals that are caught.  */
 static sigset_t caught_signals;
 
+static int sig[] =
+{
+  /* SIGINT must be first, as 'foreground' depends on it.  */
+  SIGINT
+
+#ifdef SIGHUP
+  , SIGHUP
+#endif
+#ifdef SIGPIPE
+  , SIGPIPE
+#else
+# define SIGPIPE 0
+#endif
+#ifdef SIGTERM
+  , SIGTERM
+#endif
+#ifdef SIGXCPU
+  , SIGXCPU
+#endif
+#ifdef SIGXFSZ
+  , SIGXFSZ
+#endif
+};
+
 /* If nonzero then exit with status WARNING, rather than with the usual
    signal status, on receipt of a signal with this value.  This
    suppresses a "Broken Pipe" message with some shells.  */
@@ -1755,29 +1779,6 @@ local void treat_dir (fd, dir)
 static void
 install_signal_handlers ()
 {
-  static int sig[] =
-    {
-      /* SIGINT must be first, as 'foreground' depends on it.  */
-      SIGINT
-
-#ifdef SIGHUP
-      , SIGHUP
-#endif
-#ifdef SIGPIPE
-      , SIGPIPE
-#else
-# define SIGPIPE 0
-#endif
-#ifdef SIGTERM
-      , SIGTERM
-#endif
-#ifdef SIGXCPU
-      , SIGXCPU
-#endif
-#ifdef SIGXFSZ
-      , SIGXFSZ
-#endif
-    };
   int nsigs = sizeof sig / sizeof sig[0];
   int i;
 

Reply via email to