diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-01-10 21:45:58 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-01-10 21:45:58 +0200 |
commit | 3e47f16c969b845e323f38f421a6b1da8c20c3a5 (patch) | |
tree | 3a2fc4ca6d389ec5b44d319024daa192bd3c71ab /io.c | |
parent | 163f4f479b50edfc153e9f2e77bdd9cd070e37ff (diff) | |
download | egawk-3e47f16c969b845e323f38f421a6b1da8c20c3a5.tar.gz egawk-3e47f16c969b845e323f38f421a6b1da8c20c3a5.tar.bz2 egawk-3e47f16c969b845e323f38f421a6b1da8c20c3a5.zip |
Fixes for OS/2.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1502,6 +1502,15 @@ devopen(const char *name, const char *mode) strictopen: if (openfd == INVALID_HANDLE) openfd = open(name, flag, 0666); +#ifdef __EMX__ + if (openfd == INVALID_HANDLE && errno == EACCES) { + /* on OS/2 directory access via open() is not permitted */ + struct stat buf; + + if (stat(name, &buf) == 0 && S_ISDIR(buf.st_mode)) + errno = EISDIR; + } +#endif if (openfd != INVALID_HANDLE) { if (os_isdir(openfd)) { (void) close(openfd); /* don't leak fds */ |