aboutsummaryrefslogtreecommitdiffstats
path: root/posix
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-08-08 22:51:53 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-08-08 22:51:53 +0300
commit49658bfd0ef5d4efccd210c48560c43bf455ee16 (patch)
tree424786ecd8935fa1c7a281076ce70f896bb8ce3a /posix
parent88e81c931345aa485e55c6d6c7f3ad61dc200fed (diff)
downloadegawk-49658bfd0ef5d4efccd210c48560c43bf455ee16.tar.gz
egawk-49658bfd0ef5d4efccd210c48560c43bf455ee16.tar.bz2
egawk-49658bfd0ef5d4efccd210c48560c43bf455ee16.zip
Move struct stat into IOBUF_PUBLIC.
Diffstat (limited to 'posix')
-rw-r--r--posix/ChangeLog5
-rw-r--r--posix/gawkmisc.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/posix/ChangeLog b/posix/ChangeLog
index d49ff49e..982f6bd7 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and
+ use passed in info.
+
2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.c (os_isreadable): Add isdir pointer parameter to be
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index a5c3a619..ebcee8a0 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -207,16 +207,14 @@ os_isdir(int fd)
/* os_isreadable --- fd can be read from */
int
-os_isreadable(int fd, bool *isdir)
+os_isreadable(const IOBUF_PUBLIC *iobuf, bool *isdir)
{
- struct stat sbuf;
-
*isdir = false;
- if (fstat(fd, &sbuf) != 0)
+ if (iobuf->fd == INVALID_HANDLE)
return false;
- switch (sbuf.st_mode & S_IFMT) {
+ switch (iobuf->sbuf.st_mode & S_IFMT) {
case S_IFREG:
case S_IFCHR: /* ttys, /dev/null, .. */
#ifdef S_IFSOCK