aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c6
-rw-r--r--test/ChangeLog11
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in9
-rw-r--r--test/Maketests5
-rw-r--r--test/nonfatal1.awk3
-rw-r--r--test/nonfatal1.ok4
-rw-r--r--test/nonfatal3.awk6
-rw-r--r--test/nonfatal3.ok1
10 files changed, 47 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index a0d233f3..654c96b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (pty_vs_pipe): Remove check for NULL PROCINFO_node, since
+ this is now checked inside in_PROCINFO.
+
2015-02-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (socketopen): New parameter hard_error; set it if
diff --git a/io.c b/io.c
index af963a80..162fb4e8 100644
--- a/io.c
+++ b/io.c
@@ -3704,8 +3704,10 @@ pty_vs_pipe(const char *command)
#ifdef HAVE_TERMIOS_H
NODE *val;
- if (PROCINFO_node == NULL)
- return false;
+ /*
+ * N.B. No need to check for NULL PROCINFO_node, since the
+ * in_PROCINFO function now checks that for us.
+ */
val = in_PROCINFO(command, "pty", NULL);
if (val) {
if ((val->flags & MAYBE_NUM) != 0)
diff --git a/test/ChangeLog b/test/ChangeLog
index 3b9f494f..5ece0875 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add nonfatal3.{awk,ok}.
+ (GAWK_EXT_TESTS): Add nonfatal3.
+ * nonfatal1.awk: Replace "ti10/357" with "local:host/25", since
+ "local:host" should be a universally bad hostname due to the
+ invalid ":" character.
+ * nonfatal1.ok: Update.
+ * nonfatal3.{awk,ok}: New test for connecting to a TCP port where
+ nobody is listening.
+
2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
* nonfatal1.ok: Update after code changes.
diff --git a/test/Makefile.am b/test/Makefile.am
index 1d652eca..15656ce6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -603,6 +603,8 @@ EXTRA_DIST = \
nonfatal1.ok \
nonfatal2.awk \
nonfatal2.ok \
+ nonfatal3.awk \
+ nonfatal3.ok \
nonl.awk \
nonl.ok \
noparms.awk \
@@ -1051,7 +1053,7 @@ GAWK_EXT_TESTS = \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- nonfatal1 nonfatal2 \
+ nonfatal1 nonfatal2 nonfatal3 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
profile8 pty1 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 65fd461a..87f9bf56 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -860,6 +860,8 @@ EXTRA_DIST = \
nonfatal1.ok \
nonfatal2.awk \
nonfatal2.ok \
+ nonfatal3.awk \
+ nonfatal3.ok \
nonl.awk \
nonl.ok \
noparms.awk \
@@ -1307,7 +1309,7 @@ GAWK_EXT_TESTS = \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- nonfatal1 nonfatal2 \
+ nonfatal1 nonfatal2 nonfatal3 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
profile8 pty1 \
@@ -3651,6 +3653,11 @@ nonfatal2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+nonfatal3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index c9e6a840..a2937451 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1162,6 +1162,11 @@ nonfatal2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+nonfatal3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk
index bf821d49..1eb85b1b 100644
--- a/test/nonfatal1.awk
+++ b/test/nonfatal1.awk
@@ -1,5 +1,6 @@
BEGIN {
PROCINFO["NONFATAL"]
- print |& "/inet/tcp/0/ti10/357"
+ # note that ":" is not a valid hostname character
+ print |& "/inet/tcp/0/local:host/25"
print ERRNO
}
diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok
index b22393b2..04fd705d 100644
--- a/test/nonfatal1.ok
+++ b/test/nonfatal1.ok
@@ -1,2 +1,2 @@
-gawk: nonfatal1.awk:3: warning: remote host and port information (ti10, 357) invalid
-Connection timed out
+gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid
+No such file or directory
diff --git a/test/nonfatal3.awk b/test/nonfatal3.awk
new file mode 100644
index 00000000..eace9aec
--- /dev/null
+++ b/test/nonfatal3.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ PROCINFO["NONFATAL"]
+ # valid host but bogus port
+ print |& "/inet/tcp/0/localhost/0"
+ print ERRNO
+}
diff --git a/test/nonfatal3.ok b/test/nonfatal3.ok
new file mode 100644
index 00000000..5d5be35a
--- /dev/null
+++ b/test/nonfatal3.ok
@@ -0,0 +1 @@
+Connection refused