diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 00:33:44 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 00:33:44 +0000 |
commit | 6af6d566ea12ded80ffee69723f6efb94074bf93 (patch) | |
tree | 3f18a4fa3f1604c5fb61080c3de3a2c21cdfbcd0 /file.c | |
parent | aa6e12f8e1ae1cc841ff9cc414899041ac915759 (diff) | |
download | ruby-6af6d566ea12ded80ffee69723f6efb94074bf93.tar.gz |
* file.c (ruby_is_fd_loadable): this should be fail if st_mode is
not regular file nor FIFO.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -5680,13 +5680,17 @@ ruby_is_fd_loadable(int fd) if (fstat(fd, &st) < 0) return 0; - if (S_ISREG(st.st_mode)) return 1; - if (!S_ISDIR(st.st_mode)) + + if (S_ISFIFO(st.st_mode)) return 1; - errno = EISDIR; + if (S_ISDIR(st.st_mode)) + errno = EISDIR; + else + errno = ENXIO; + return 0; #endif } |