diff options
Diffstat (limited to 'vms/gawkmisc.vms')
-rw-r--r-- | vms/gawkmisc.vms | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms index f373b5f2..773b3556 100644 --- a/vms/gawkmisc.vms +++ b/vms/gawkmisc.vms @@ -147,10 +147,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; @@ -164,6 +166,9 @@ os_isreadable(int fd) case S_IFIFO: #endif return true; + case S_IFDIR: + *isdir = true; + /* fall through */ default: return false; } |