summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2023-12-25 22:29:18 +0200
committerArnold D. Robbins <arnold@skeeve.com>2023-12-25 22:29:18 +0200
commite9a78cb00374c49d3f2fd26fbe04fc05895b5ea7 (patch)
tree6e18a7caf9e0939d78efe0e06d07ebdbe4233a0c
parent4217d4bd8600d49335d8a1d2922d5a1ee1921d7c (diff)
downloadgawk-e9a78cb00374c49d3f2fd26fbe04fc05895b5ea7.tar.gz
Make GAWK_READ_TIMEOUT work correctly.
-rw-r--r--ChangeLog6
-rw-r--r--io.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ab3e2fb..25d46f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (get_read_timeout): Make gawk match the doc and have
+ GAWK_READ_TIMEOUT work if no entry in PROCINFO. Thanks
+ to Ed Morton for the report.
+
2023-12-24 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (print_array): Use the subscript as the
diff --git a/io.c b/io.c
index 881178e..c423da6 100644
--- a/io.c
+++ b/io.c
@@ -4424,7 +4424,7 @@ in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx)
static long
get_read_timeout(IOBUF *iop)
{
- long tmout = 0;
+ long tmout = read_default_timeout; /* initialized from env. variable in init_io() */
if (PROCINFO_node != NULL) {
const char *name = iop->public.name;
@@ -4448,8 +4448,7 @@ get_read_timeout(IOBUF *iop)
(void) force_number(val);
tmout = get_number_si(val);
}
- } else
- tmout = read_default_timeout; /* initialized from env. variable in init_io() */
+ }
/* overwrite read routine only if an extension has not done so */
if ((iop->public.read_func == ( ssize_t(*)() ) read) && tmout > 0)