aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-02-08 20:01:32 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-02-08 20:01:32 +0200
commit7f9f66525d7d82816eba352efdf58497373a47bf (patch)
tree114c8f7d46aa478599e7a3a3e00cce4316dfd78b /io.c
parent0e38201f5879cc91c90876b2b9b219a308e3a2d2 (diff)
downloadegawk-7f9f66525d7d82816eba352efdf58497373a47bf.tar.gz
egawk-7f9f66525d7d82816eba352efdf58497373a47bf.tar.bz2
egawk-7f9f66525d7d82816eba352efdf58497373a47bf.zip
Use "NONFATAL" for nonfatal I/O.
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/io.c b/io.c
index db8a0a2b..f975353e 100644
--- a/io.c
+++ b/io.c
@@ -1069,15 +1069,17 @@ getredirect(const char *str, int len)
bool
is_non_fatal_std(FILE *fp)
{
- if (in_PROCINFO("nonfatal", NULL, NULL))
+ static const char nonfatal[] = "NONFATAL";
+
+ if (in_PROCINFO(nonfatal, NULL, NULL))
return true;
/* yucky logic. sigh. */
if (fp == stdout) {
- return ( in_PROCINFO("-", "nonfatal", NULL) != NULL
- || in_PROCINFO("/dev/stdout", "nonfatal", NULL) != NULL);
+ return ( in_PROCINFO("-", nonfatal, NULL) != NULL
+ || in_PROCINFO("/dev/stdout", nonfatal, NULL) != NULL);
} else if (fp == stderr) {
- return (in_PROCINFO("/dev/stderr", "nonfatal", NULL) != NULL);
+ return (in_PROCINFO("/dev/stderr", nonfatal, NULL) != NULL);
}
return false;
@@ -1088,8 +1090,8 @@ is_non_fatal_std(FILE *fp)
bool
is_non_fatal_redirect(const char *str)
{
- return in_PROCINFO("nonfatal", NULL, NULL) != NULL
- || in_PROCINFO(str, "nonfatal", NULL) != NULL;
+ return in_PROCINFO("NONFATAL", NULL, NULL) != NULL
+ || in_PROCINFO(str, "NONFATAL", NULL) != NULL;
}
/* close_one --- temporarily close an open file to re-use the fd */