aboutsummaryrefslogtreecommitdiffstats
path: root/unsupported/atari/gawkmisc.atr
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:14:38 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:14:38 +0300
commitfae4762eba9ff7bb466a600130e9c90eaac6b0bc (patch)
tree62711fe7cd511824b5f8a90ba1ba7b523d42e127 /unsupported/atari/gawkmisc.atr
parentbc70de7b3302d5a81515b901cae376b8b51d2004 (diff)
downloadegawk-fae4762eba9ff7bb466a600130e9c90eaac6b0bc.tar.gz
egawk-fae4762eba9ff7bb466a600130e9c90eaac6b0bc.tar.bz2
egawk-fae4762eba9ff7bb466a600130e9c90eaac6b0bc.zip
Move to gawk-3.1.1.
Diffstat (limited to 'unsupported/atari/gawkmisc.atr')
-rw-r--r--unsupported/atari/gawkmisc.atr9
1 files changed, 4 insertions, 5 deletions
diff --git a/unsupported/atari/gawkmisc.atr b/unsupported/atari/gawkmisc.atr
index 85bfa29d..f4ee1fc1 100644
--- a/unsupported/atari/gawkmisc.atr
+++ b/unsupported/atari/gawkmisc.atr
@@ -1,5 +1,5 @@
/*
- * gawkmisc.atr --- miscellanious gawk routines that are OS specific.
+ * gawkmisc.atr --- miscellaneous gawk routines that are OS specific.
*/
/*
@@ -94,13 +94,12 @@ struct stat *stb;
* On ST redirected stdin does not have a name attached
* (this could be hard to do to) and fstat would fail
*/
- if (fd == 0 || isatty(fd))
+ if (fd == 0)
return BUFSIZ;
if (fstat(fd, stb) == -1)
fatal("can't stat fd %d (%s)", fd, strerror(errno));
- if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */
- return DEFBLKSIZE;
- if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */
+ if (S_ISREG(stb->st_mode)
+ && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */
return stb->st_size;
return DEFBLKSIZE;
}