aboutsummaryrefslogtreecommitdiffstats
path: root/pc
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 /pc
parent207fc1458c7f168822e454a89f23428c64163427 (diff)
downloadegawk-82816b279615b27f7c4f87349a8c830a96939d8c.tar.gz
egawk-82816b279615b27f7c4f87349a8c830a96939d8c.tar.bz2
egawk-82816b279615b27f7c4f87349a8c830a96939d8c.zip
Finish work on iop management. New readdir test.
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog5
-rw-r--r--pc/gawkmisc.pc7
2 files changed, 11 insertions, 1 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 43221928..28dfb72b 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_isreadable): Add isdir pointer parameter to be
+ set to true if fd is for a directory.
+
2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.pc (os_isreadable): New function.
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 999167ca..d79a3207 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -235,10 +235,12 @@ 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;
@@ -252,6 +254,9 @@ os_isreadable(int fd)
case S_IFIFO:
#endif
return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
default:
return false;
}