gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2456-g5b7042


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2456-g5b7042e
Date: Mon, 27 Mar 2017 13:30:52 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  5b7042ea0a68d41c4fbd0d6228f77975ebf8c38b (commit)
       via  45099c6ece4f4e91f0d525d10a6d4d162d30e6e4 (commit)
       via  a62ecbb9f3f17cc69a7a464954fa42b30c57aa47 (commit)
      from  d37c160b819d3a828fac6ed037e835158ac23c85 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=5b7042ea0a68d41c4fbd0d6228f77975ebf8c38b

commit 5b7042ea0a68d41c4fbd0d6228f77975ebf8c38b
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Mar 27 20:30:14 2017 +0300

    Die with SIGPIPE when EPIPE happens on stdout.

diff --git a/ChangeLog b/ChangeLog
index d84b38c..6822c6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-03-27         Arnold D. Robbins     <address@hidden>
+
+       Cause EPIPE errors to stdout to generate a real SIGPIPE.
+
+       * awk.h (die_via_sigpipe): New macro.
+       * builtin.c (efwrite): Use it.
+       * io.c (non_fatal_flush_std_file): Ditto.
+       * main.c (usage): Ditto.
+
 2017-03-25         Arnold D. Robbins     <address@hidden>
 
        * io.c (flush_io): Use r_fatal and r_warning for messagefunc
diff --git a/awk.h b/awk.h
index 163ad36..c1e9b4a 100644
--- a/awk.h
+++ b/awk.h
@@ -1966,7 +1966,9 @@ erealloc_real(void *ptr, size_t count, const char *where, 
const char *var, const
 #ifdef SIGPIPE
 #define ignore_sigpipe() signal(SIGPIPE, SIG_IGN)
 #define set_sigpipe_to_default() signal(SIGPIPE, SIG_DFL)
+#define die_via_sigpipe() (signal(SIGPIPE, SIG_DFL), kill(getpid(), SIGPIPE))
 #else
 #define ignore_sigpipe()
 #define set_sigpipe_to_default()
+#define die_via_sigpipe() exit(EXIT_FATAL)
 #endif
diff --git a/builtin.c b/builtin.c
index 0f2c62f..e2143b3 100644
--- a/builtin.c
+++ b/builtin.c
@@ -129,9 +129,9 @@ wrerror:
        if (errno == 0 || errno == EINVAL)
                w32_maybe_set_errno();
 #endif
-       /* die silently on EPIPE to stdout */
+       /* for stdout, die with a real SIGPIPE, like other awks */
        if (fp == stdout && errno == EPIPE)
-               gawk_exit(EXIT_SUCCESS);        // a la SIGPIPE
+               die_via_sigpipe();
 
        /* otherwise die verbosely */
        if ((rp != NULL) ? is_non_fatal_redirect(rp->value, strlen(rp->value)) 
: is_non_fatal_std(fp))
diff --git a/io.c b/io.c
index fa9225c..b00f4db 100644
--- a/io.c
+++ b/io.c
@@ -1400,7 +1400,7 @@ non_fatal_flush_std_file(FILE *fp)
 
                if (is_fatal) {
                        if (errno == EPIPE)
-                               exit(EXIT_SUCCESS);     // simulate SIGPIPE
+                               die_via_sigpipe();
                        else
                                fatal(fp == stdout
                                        ? _("fflush: cannot flush standard 
output: %s")
diff --git a/main.c b/main.c
index 4f578d3..73e6344 100644
--- a/main.c
+++ b/main.c
@@ -633,7 +633,10 @@ By default it reads standard input and writes standard 
output.\n\n"), fp);
                                warning(_("error writing standard output 
(%s)"), strerror(errno));
                        else if (fp == stderr)
                                warning(_("error writing standard error (%s)"), 
strerror(errno));
-               }
+               } else if (errno == SIGPIPE)
+                       die_via_sigpipe();
+
+               // some other problem than SIGPIPE
                exit(EXIT_FAILURE);
        }
 

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=45099c6ece4f4e91f0d525d10a6d4d162d30e6e4

commit 45099c6ece4f4e91f0d525d10a6d4d162d30e6e4
Merge: d37c160 a62ecbb
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Mar 27 20:24:53 2017 +0300

    Merge branch 'gawk-4.1-stable'

diff --cc vms/ChangeLog
index a2354c1,2268148..af9a953
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@@ -1,11 -1,10 +1,15 @@@
+ 2017-03-25         John E. Malmberg      <address@hidden>
+ 
 -        * vmstest.com: Fix argarray teset.
++      * vmstest.com: Fix argarray teset.
++
 +2016-12-22         John E. Malmberg      <address@hidden>
 +
-         * vmsbuild.com, descrip.mms:
-         Update for new [.support] directory.
++      * vmsbuild.com, descrip.mms:
++      Update for new [.support] directory.
  
  2016-11-24         John E. Malmberg      <address@hidden>
  
--        * gawk_verb.com: correct location for gawk executable.
++      * gawk_verb.com: correct location for gawk executable.
  
  2016-10-24         John E. Malmberg      <address@hidden>
  

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |  9 +++++++++
 awk.h           |  2 ++
 builtin.c       |  4 ++--
 io.c            |  2 +-
 main.c          |  5 ++++-
 vms/ChangeLog   | 10 +++++++---
 vms/vmstest.com |  4 +++-
 7 files changed, 28 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]