| Index: runtime/bin/file_linux.cc
|
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
|
| index ce0ef27bb26c5ea84f21e13424b345098c4d2f4e..df43d2d86c9788693a7b9b563123a1160b2963e3 100644
|
| --- a/runtime/bin/file_linux.cc
|
| +++ b/runtime/bin/file_linux.cc
|
| @@ -107,7 +107,8 @@ File* File::Open(const char* name, FileOpenMode mode) {
|
| // Report errors for non-regular files.
|
| struct stat st;
|
| if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) {
|
| - if (!S_ISREG(st.st_mode)) {
|
| + // Only accept regular files and character devices.
|
| + if (!S_ISREG(st.st_mode) && !S_ISCHR(st.st_mode)) {
|
| errno = (S_ISDIR(st.st_mode)) ? EISDIR : ENOENT;
|
| return NULL;
|
| }
|
|
|