aboutsummaryrefslogtreecommitdiffstats
path: root/posix/gawkmisc.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-07-29 16:33:00 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-07-29 16:33:00 +0300
commit82816b279615b27f7c4f87349a8c830a96939d8c (patch)
treecf30bf71692e090ca6ca4934e65184aa990a3055 /posix/gawkmisc.c
parent207fc1458c7f168822e454a89f23428c64163427 (diff)
downloadegawk-82816b279615b27f7c4f87349a8c830a96939d8c.tar.gz
egawk-82816b279615b27f7c4f87349a8c830a96939d8c.tar.bz2
egawk-82816b279615b27f7c4f87349a8c830a96939d8c.zip
Finish work on iop management. New readdir test.
Diffstat (limited to 'posix/gawkmisc.c')
-rw-r--r--posix/gawkmisc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index 87a6747c..a5c3a619 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -207,10 +207,12 @@ os_isdir(int fd)
/* os_isreadable --- fd can be read from */
int
-os_isreadable(int fd)
+os_isreadable(int fd, bool *isdir)
{
struct stat sbuf;
+ *isdir = false;
+
if (fstat(fd, &sbuf) != 0)
return false;
@@ -224,6 +226,9 @@ os_isreadable(int fd)
case S_IFIFO:
#endif
return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
default:
return false;
}