diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-08 20:01:32 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-08 20:01:32 +0200 |
commit | 7f9f66525d7d82816eba352efdf58497373a47bf (patch) | |
tree | 114c8f7d46aa478599e7a3a3e00cce4316dfd78b /io.c | |
parent | 0e38201f5879cc91c90876b2b9b219a308e3a2d2 (diff) | |
download | egawk-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.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 */ |