gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, master, updated. gawk-4.1.0-4815-gf1e57af4


From: Arnold Robbins
Subject: [SCM] gawk branch, master, updated. gawk-4.1.0-4815-gf1e57af4
Date: Fri, 29 Jul 2022 04:08:31 -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  f1e57af42496dbbc043a02dcb039c180ac39c382 (commit)
       via  ea9b6f925647070824ce5e84ed8e5eb816578ed5 (commit)
       via  b71848d4f6ada1caade4289cc599561392f8be20 (commit)
      from  74fcab9e4307e0d6a85c6e269eed3da276df08a4 (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=f1e57af42496dbbc043a02dcb039c180ac39c382

commit f1e57af42496dbbc043a02dcb039c180ac39c382
Merge: ea9b6f92 74fcab9e
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Jul 29 11:08:17 2022 +0300

    Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/gawk

diff --cc ChangeLog
index 7da12705,a697ba7c..b304a409
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,10 -1,17 +1,24 @@@
 +2022-07-29         Arnold D. Robbins     <arnold@skeeve.com>
 +
 +      * builtin.c (efwrite): Check ferror() also, fixes some weird
 +      cases. Reported by Nikita Zlobin <cook60020tmp@mail.ru>.
 +      * io.c (gawk_fwrite): Remove static from definition.
 +      * awk.h (gawk_fwrite): Add declaration.
 +
+ 2022-07-27         Arnold D. Robbins     <arnold@skeeve.com>
+ 
+       * gawkapi.c (awk_value_to_node): Put tval declaration inside
+       MPFR ifdef. Avoids warning if no MPFR when compiling.
+ 
+ 2022-07-26         Arnold D. Robbins     <arnold@skeeve.com>
+ 
+       * io.c (iopflags2str): Remove 'static' from declaration, causes
+       the compiler to stop complaining. Thanks to Pat Rankin for the
+       suggestion.
+       * re.c (reflags2str): Ditto.
+       * debug.c (debug_prog): Translate the "Restarting ..." message.
+       Thanks to Antonio Colombo for pointing this out.
+ 
  2022-07-22         Arnold D. Robbins     <arnold@skeeve.com>
  
        * NEWS: Updated.

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

commit ea9b6f925647070824ce5e84ed8e5eb816578ed5
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Jul 29 11:06:50 2022 +0300

    Update build-aux.

diff --git a/build-aux/ChangeLog b/build-aux/ChangeLog
index 76e5d049..1c5bcc0a 100644
--- a/build-aux/ChangeLog
+++ b/build-aux/ChangeLog
@@ -1,3 +1,7 @@
+2022-07-29         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * compile: Updated from GNULIB.
+
 2022-07-21         Arnold D. Robbins     <arnold@skeeve.com>
 
        * ltmain.sh: Updated to Libtool 2.4.7.
diff --git a/build-aux/compile b/build-aux/compile
index 2078fc83..dfc94659 100755
--- a/build-aux/compile
+++ b/build-aux/compile
@@ -256,6 +256,7 @@ EOF
     exit $?
     ;;
   cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
   icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
     func_cl_wrapper "$@"      # Doesn't return...
     ;;

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

commit b71848d4f6ada1caade4289cc599561392f8be20
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Jul 29 11:05:25 2022 +0300

    Improve error checking on output.

diff --git a/ChangeLog b/ChangeLog
index cf5dd1aa..7da12705 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-07-29         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * builtin.c (efwrite): Check ferror() also, fixes some weird
+       cases. Reported by Nikita Zlobin <cook60020tmp@mail.ru>.
+       * io.c (gawk_fwrite): Remove static from definition.
+       * awk.h (gawk_fwrite): Add declaration.
+
 2022-07-22         Arnold D. Robbins     <arnold@skeeve.com>
 
        * NEWS: Updated.
diff --git a/awk.h b/awk.h
index dacf6f32..84fd714c 100644
--- a/awk.h
+++ b/awk.h
@@ -1665,6 +1665,7 @@ 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);
+extern size_t gawk_fwrite(const void *buf, size_t size, size_t count, FILE 
*fp, void *opaque);
 
 /* main.c */
 extern int arg_assign(char *arg, bool initing);
diff --git a/builtin.c b/builtin.c
index 30795406..21125453 100644
--- a/builtin.c
+++ b/builtin.c
@@ -167,11 +167,27 @@ efwrite(const void *ptr,
 {
        errno = 0;
        if (rp != NULL) {
-               if (rp->output.gawk_fwrite(ptr, size, count, fp, 
rp->output.opaque) != count) {
+               /*
+                * 7/2022: We need to also check ferror(); there can be times 
when write(2) fails but
+                * fwrite succeeds!  To do that, we make sure that 
rp->output.gawk_fwrite is not
+                * taken over by an extension before checking ferror().  From 
the bug report
+                * 
(https://lists.gnu.org/archive/html/bug-gawk/2022-07/msg00000.html):
+                *
+                * Minimal working example:
+                * yes | stdbuf -oL gawk '{print}' | head -n1 # Prints but hangs
+                * yes | stdbuf -o0 gawk '{print}' | head -n1 # OK
+                * yes | gawk '{print; fflush()}'  | head -n1 # OK
+                *
+                * After this change, all three work.
+                */
+               bool err_on_write = (rp->output.gawk_fwrite(ptr, size, count, 
fp, rp->output.opaque) != count);
+               bool err_on_fp = (rp->output.gawk_fwrite == gawk_fwrite && 
ferror(fp));
+
+               if (err_on_write || err_on_fp) {
                        wrerror(fp, from, rp);
                        return;
                }
-       } else if (fwrite(ptr, size, count, fp) != count) {
+       } else if (fwrite(ptr, size, count, fp) != count || ferror(fp)) {
                wrerror(fp, from, rp);
                return;
        }
diff --git a/io.c b/io.c
index 91fa2225..d7372b6f 100644
--- a/io.c
+++ b/io.c
@@ -4413,7 +4413,7 @@ read_with_timeout(int fd, void *buf, size_t size)
 
 /* gawk_fwrite --- like fwrite */
 
-static size_t
+size_t
 gawk_fwrite(const void *buf, size_t size, size_t count, FILE *fp, void *opaque)
 {
        (void) opaque;

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

Summary of changes:
 ChangeLog           |  7 +++++++
 awk.h               |  1 +
 build-aux/ChangeLog |  4 ++++
 build-aux/compile   |  1 +
 builtin.c           | 20 ++++++++++++++++++--
 io.c                |  2 +-
 6 files changed, 32 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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