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-2448-gefc7e9


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2448-gefc7e96
Date: Mon, 20 Mar 2017 15:20:42 -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  efc7e96c876ccf3b83ab3249eca852a0292ff943 (commit)
       via  7ec5068a7419cc4dddcf7e060077a1287217c5cd (commit)
      from  de684770acc545bf14f85655d44fe91e9afa0ba3 (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=efc7e96c876ccf3b83ab3249eca852a0292ff943

commit efc7e96c876ccf3b83ab3249eca852a0292ff943
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Mar 20 21:20:12 2017 +0200

    Update config.* and install-sh from GNULIB.

diff --git a/ChangeLog b/ChangeLog
index c430cd4..8290a5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,11 @@
        * io.c (redirect_string, two_way_open, gawk_popen): Ditto.
        (flush_io): Use non_fatal_flush_std for stdout and stderr.
 
+       Unrelated:
+
+       * config.guess, config.rpath, config.sub, install-sh:
+       Sync with GNULIB.
+
 2017-03-16         Arnold D. Robbins     <address@hidden>
 
        * configure.ac: Some cleanups.
diff --git a/config.guess b/config.guess
index bbd48b6..69ed3e5 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-01-01'
+timestamp='2017-03-05'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -837,10 +837,11 @@ EOF
        UNAME_PROCESSOR=`/usr/bin/uname -p`
        case ${UNAME_PROCESSOR} in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 
's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 
's/[-(].*//'`
        exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
@@ -1343,6 +1344,9 @@ EOF
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
        exit ;;
+    NSX-?:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
        exit ;;
diff --git a/config.rpath b/config.rpath
index 98183ff..af3c415 100755
--- a/config.rpath
+++ b/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Copyright 1996-2017 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #
diff --git a/config.sub b/config.sub
index 7e792b4..87abeab 100755
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-01-01'
+timestamp='2017-02-07'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -948,6 +948,9 @@ case $basic_machine in
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
+       nsx-tandem)
+               basic_machine=nsx-tandem
+               ;;
        op50n-* | op60c-*)
                basic_machine=hppa1.1-oki
                os=-proelf
diff --git a/extension/build-aux/ChangeLog b/extension/build-aux/ChangeLog
index 35e5cfd..af72634 100644
--- a/extension/build-aux/ChangeLog
+++ b/extension/build-aux/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-20         Arnold D. Robbins     <address@hidden>
+
+       * config.guess, config.rpath, config.sub, install-sh:
+       Sync with GNULIB.
+
 2017-01-04         Arnold Robbins        <address@hidden>
 
        * config.guess, config.sub, compile, depcomp: Sync from latest
diff --git a/extension/build-aux/config.guess b/extension/build-aux/config.guess
index bbd48b6..69ed3e5 100755
--- a/extension/build-aux/config.guess
+++ b/extension/build-aux/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-01-01'
+timestamp='2017-03-05'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -837,10 +837,11 @@ EOF
        UNAME_PROCESSOR=`/usr/bin/uname -p`
        case ${UNAME_PROCESSOR} in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 
's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 
's/[-(].*//'`
        exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
@@ -1343,6 +1344,9 @@ EOF
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
        exit ;;
+    NSX-?:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
        exit ;;
diff --git a/extension/build-aux/config.rpath b/extension/build-aux/config.rpath
index 98183ff..af3c415 100755
--- a/extension/build-aux/config.rpath
+++ b/extension/build-aux/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Copyright 1996-2017 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #
diff --git a/extension/build-aux/config.sub b/extension/build-aux/config.sub
index 7e792b4..87abeab 100755
--- a/extension/build-aux/config.sub
+++ b/extension/build-aux/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-01-01'
+timestamp='2017-02-07'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -948,6 +948,9 @@ case $basic_machine in
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
+       nsx-tandem)
+               basic_machine=nsx-tandem
+               ;;
        op50n-* | op60c-*)
                basic_machine=hppa1.1-oki
                os=-proelf
diff --git a/extension/build-aux/install-sh b/extension/build-aux/install-sh
index 0b0fdcb..0360b79 100755
--- a/extension/build-aux/install-sh
+++ b/extension/build-aux/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2016-01-11.22; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -496,6 +496,6 @@ done
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/install-sh b/install-sh
index 0b0fdcb..0360b79 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2016-01-11.22; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -496,6 +496,6 @@ done
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=7ec5068a7419cc4dddcf7e060077a1287217c5cd

commit 7ec5068a7419cc4dddcf7e060077a1287217c5cd
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Mar 20 21:15:03 2017 +0200

    Improve handling of EPIPE and fflush.

diff --git a/ChangeLog b/ChangeLog
index a0f26b2..c430cd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2017-03-20         Arnold D. Robbins     <address@hidden>
+
+       Improve handling of EPIPE. Problems reported by
+       Alexandre Ferrieux <address@hidden>
+       and David Kerns <address@hidden>.
+
+       * awk.h (ignore_sigpipe, set_sigpipe_to_default,
+       non_fatal_flush_std): Declare new functions.
+       (ignore_sigpipe, set_sigpipe_to_default,
+       non_fatal_flush_std): New macros.
+       * builtin.c (do_fflush): When nonfatal not in force, flush
+       of stdout/stderr and EPIPE exits, simulating SIGPIPE, as
+       in nawk/mawk. Flush of other redirections with EPIPE now
+       also fatals.
+       (do_system): Use ignore_sipipe and set_sigpipe_to_default
+       instead of uglier inline ifdefed code.
+       * main.c (main): Ditto.
+       * io.c (redirect_string, two_way_open, gawk_popen): Ditto.
+       (flush_io): Use non_fatal_flush_std for stdout and stderr.
+
 2017-03-16         Arnold D. Robbins     <address@hidden>
 
        * configure.ac: Some cleanups.
diff --git a/awk.h b/awk.h
index aae5e7e..163ad36 100644
--- a/awk.h
+++ b/awk.h
@@ -1584,6 +1584,10 @@ extern bool inrec(IOBUF *iop, int *errcode);
 extern int nextfile(IOBUF **curfile, bool skipping);
 extern bool is_non_fatal_std(FILE *fp);
 extern bool is_non_fatal_redirect(const char *str, size_t len);
+extern void ignore_sigpipe(void);
+extern void set_sigpipe_to_default(void);
+extern bool non_fatal_flush_std_file(FILE *fp);
+
 /* main.c */
 extern int arg_assign(char *arg, bool initing);
 extern int is_std_var(const char *var);
@@ -1958,3 +1962,11 @@ erealloc_real(void *ptr, size_t count, const char 
*where, const char *var, const
 
        return ret;
 }
+
+#ifdef SIGPIPE
+#define ignore_sigpipe() signal(SIGPIPE, SIG_IGN)
+#define set_sigpipe_to_default() signal(SIGPIPE, SIG_DFL)
+#else
+#define ignore_sigpipe()
+#define set_sigpipe_to_default()
+#endif
diff --git a/builtin.c b/builtin.c
index 2acd992..b92eb19 100644
--- a/builtin.c
+++ b/builtin.c
@@ -133,7 +133,6 @@ wrerror:
        if (fp == stdout && errno == EPIPE)
                gawk_exit(EXIT_FATAL);
 
-
        /* otherwise die verbosely */
        if ((rp != NULL) ? is_non_fatal_redirect(rp->value, strlen(rp->value)) 
: is_non_fatal_std(fp))
                update_ERRNO_int(errno);
@@ -245,13 +244,19 @@ do_fflush(int nargs)
                        return make_number((AWKNUM) status);
                }
                fp = rp->output.fp;
-               if (fp != NULL)
+               if (fp != NULL) {
                        status = rp->output.gawk_fflush(fp, rp->output.opaque);
-               else if ((rp->flag & RED_TWOWAY) != 0)
+
+                       if (status != 0) {
+                               if (! is_non_fatal_redirect(tmp->stptr, 
tmp->stlen))
+                                       fatal(_("fflush: cannot flush file 
`%.*s': %s"),
+                                               len, file, strerror(errno));
+                       }
+               } else if ((rp->flag & RED_TWOWAY) != 0)
                                warning(_("fflush: cannot flush: two-way pipe 
`%.*s' has closed write end"),
                                        len, file);
        } else if ((fp = stdfile(tmp->stptr, tmp->stlen)) != NULL) {
-               status = fflush(fp);
+               status = (non_fatal_flush_std_file(fp) == false);
        } else {
                status = -1;
                warning(_("fflush: `%.*s' is not an open file, pipe or 
co-process"), len, file);
@@ -2148,9 +2153,7 @@ do_system(int nargs)
                cmd[tmp->stlen] = '\0';
 
                os_restore_mode(fileno(stdin));
-#ifdef SIGPIPE
-               signal(SIGPIPE, SIG_DFL);
-#endif
+               set_sigpipe_to_default();
 
                status = system(cmd);
                /*
@@ -2176,9 +2179,7 @@ do_system(int nargs)
 
                if ((BINMODE & BINMODE_INPUT) != 0)
                        os_setbinmode(fileno(stdin), O_BINARY);
-#ifdef SIGPIPE
-               signal(SIGPIPE, SIG_IGN);
-#endif
+               ignore_sigpipe();
 
                cmd[tmp->stlen] = save;
        }
diff --git a/io.c b/io.c
index cced126..0da2757 100644
--- a/io.c
+++ b/io.c
@@ -899,9 +899,7 @@ redirect_string(const char *str, size_t explen, bool 
not_string,
                        (void) flush_io();
 
                        os_restore_mode(fileno(stdin));
-#ifdef SIGPIPE
-                       signal(SIGPIPE, SIG_DFL);
-#endif
+                       set_sigpipe_to_default();
                        /*
                         * Don't check failure_fatal; see input pipe below.
                         * Note that the failure happens upon failure to fork,
@@ -911,9 +909,7 @@ redirect_string(const char *str, size_t explen, bool 
not_string,
                        if ((rp->output.fp = popen(str, binmode("w"))) == NULL)
                                fatal(_("can't open pipe `%s' for output (%s)"),
                                                str, strerror(errno));
-#ifdef SIGPIPE
-                       signal(SIGPIPE, SIG_IGN);
-#endif
+                       ignore_sigpipe();
 
                        /* set close-on-exec */
                        os_close_on_exec(fileno(rp->output.fp), str, "pipe", 
"to");
@@ -1392,6 +1388,36 @@ checkwarn:
        return status;
 }
 
+/* non_fatal_flush_std_file --- flush a standard output file allowing for 
nonfatal setting */
+
+bool
+non_fatal_flush_std_file(FILE *fp)
+{
+       int status = fflush(fp);
+
+       if (status != 0) {
+               bool is_fatal = ! is_non_fatal_std(fp);
+
+               if (is_fatal) {
+                       if (errno == EPIPE)
+                               exit(EXIT_SUCCESS);     // simulate SIGPIPE
+                       else
+                               fatal(fp == stdout
+                                       ? _("fflush: cannot flush standard 
output: %s")
+                                       : _("fflush: cannot flush standard 
error: %s"),
+                                               strerror(errno));
+               } else {
+                       warning(fp == stdout
+                               ? _("error writing standard output (%s)")
+                               : _("error writing standard error (%s)"),
+                                       strerror(errno));
+               }
+               return false;
+       }
+
+       return true;
+}
+
 /* flush_io --- flush all open output files */
 
 int
@@ -1401,21 +1427,18 @@ flush_io()
        int status = 0;
 
        errno = 0;
-       /* we don't warn about stdout/stderr if EPIPE, but we do error exit */
-       if (fflush(stdout)) {
-               if (errno != EPIPE)
-                       warning(_("error writing standard output (%s)"), 
strerror(errno));
+       if (! non_fatal_flush_std_file(stdout))
                status++;
-       }
-       if (fflush(stderr)) {
-               if (errno != EPIPE)
-                       warning(_("error writing standard error (%s)"), 
strerror(errno));
+
+       errno = 0;
+       if (! non_fatal_flush_std_file(stderr))
                status++;
-       }
+
+       // now for all open redirections
        for (rp = red_head; rp != NULL; rp = rp->next) {
                /* flush both files and pipes, what the heck */
                if ((rp->flag & RED_WRITE) != 0 && rp->output.fp != NULL) {
-                       if (rp->output.gawk_fflush(rp->output.fp, 
rp->output.opaque)) {
+                       if (rp->output.gawk_fflush(rp->output.fp, 
rp->output.opaque) != 0) {
                                if ((rp->flag & RED_PIPE) != 0)
                                        warning(_("pipe flush of `%s' failed 
(%s)."),
                                                rp->value, strerror(errno));
@@ -2076,7 +2099,7 @@ two_way_open(const char *str, struct redirect *rp, int 
extfd)
 
                        /* stderr does NOT get dup'ed onto child's stdout */
 
-                       signal(SIGPIPE, SIG_DFL);
+                       set_sigpipe_to_default();
 
                        execl("/bin/sh", "sh", "-c", str, NULL);
                        _exit(errno == ENOENT ? 127 : 126);
@@ -2253,7 +2276,7 @@ use_pipes:
                    || close(ctop[0]) == -1 || close(ctop[1]) == -1)
                        fatal(_("close of pipe failed (%s)"), strerror(errno));
                /* stderr does NOT get dup'ed onto child's stdout */
-               signal(SIGPIPE, SIG_DFL);
+               set_sigpipe_to_default();
                execl("/bin/sh", "sh", "-c", str, NULL);
                _exit(errno == ENOENT ? 127 : 126);
        }
@@ -2490,7 +2513,7 @@ gawk_popen(const char *cmd, struct redirect *rp)
                        fatal(_("moving pipe to stdout in child failed (dup: 
%s)"), strerror(errno));
                if (close(p[0]) == -1 || close(p[1]) == -1)
                        fatal(_("close of pipe failed (%s)"), strerror(errno));
-               signal(SIGPIPE, SIG_DFL);
+               set_sigpipe_to_default();
                execl("/bin/sh", "sh", "-c", cmd, NULL);
                _exit(errno == ENOENT ? 127 : 126);
        }
@@ -2555,17 +2578,13 @@ gawk_popen(const char *cmd, struct redirect *rp)
        FILE *current;
 
        os_restore_mode(fileno(stdin));
-#ifdef SIGPIPE
-       signal(SIGPIPE, SIG_DFL);
-#endif
+       set_sigpipe_to_default();
 
        current = popen(cmd, binmode("r"));
 
        if ((BINMODE & BINMODE_INPUT) != 0)
                os_setbinmode(fileno(stdin), O_BINARY);
-#ifdef SIGPIPE
-       signal(SIGPIPE, SIG_IGN);
-#endif
+       ignore_sigpipe();
 
        if (current == NULL)
                return NULL;
diff --git a/main.c b/main.c
index 56482f5..4f578d3 100644
--- a/main.c
+++ b/main.c
@@ -255,7 +255,7 @@ main(int argc, char **argv)
 #ifdef SIGBUS
        (void) signal(SIGBUS, catchsig);
 #endif
-#ifdef SIGPIPE
+
        /*
         * Ignore SIGPIPE so that writes to pipes that fail don't
         * kill the process but instead return -1 and set errno.
@@ -269,8 +269,7 @@ main(int argc, char **argv)
         * should not give us "broken pipe" messages --- mainly because
         * it did not do so in the past and people would complain.
         */
-       signal(SIGPIPE, SIG_IGN);
-#endif
+       ignore_sigpipe();
 
        (void) sigsegv_install_handler(catchsegv);
 #define STACK_SIZE (16*1024)

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

Summary of changes:
 ChangeLog                        | 25 +++++++++++++++
 awk.h                            | 12 +++++++
 builtin.c                        | 21 ++++++------
 config.guess                     | 12 ++++---
 config.rpath                     |  2 +-
 config.sub                       |  5 ++-
 extension/build-aux/ChangeLog    |  5 +++
 extension/build-aux/config.guess | 12 ++++---
 extension/build-aux/config.rpath |  2 +-
 extension/build-aux/config.sub   |  5 ++-
 extension/build-aux/install-sh   |  4 +--
 install-sh                       |  4 +--
 io.c                             | 69 +++++++++++++++++++++++++---------------
 main.c                           |  5 ++-
 14 files changed, 129 insertions(+), 54 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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