aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-17 23:41:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-17 23:41:14 +0000
commitd6379666cad4bda4e147b9f9bb2d07a80a1a3aa9 (patch)
tree0b0ce992288bef0ed0533a167686d8ae7518d217 /file.c
parentd5cb997f18ad94969043d7847c7e22cef2483eca (diff)
downloadruby-d6379666cad4bda4e147b9f9bb2d07a80a1a3aa9.tar.gz
file.c: set errno
* file.c (ruby_is_fd_loadable): set proper errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/file.c b/file.c
index 6f3a4378fd..b2ad989df6 100644
--- a/file.c
+++ b/file.c
@@ -5683,9 +5683,10 @@ ruby_is_fd_loadable(int fd)
if (S_ISREG(st.st_mode))
return 1;
- if (S_ISFIFO(st.st_mode))
+ if (!S_ISDIR(st.st_mode))
return 1;
+ errno = EISDIR;
return 0;
#endif
}