|
|
@ -495,12 +495,8 @@ io::ZeroCopyInputStream* DiskSourceTree::OpenDiskFile( |
|
|
|
do { |
|
|
|
do { |
|
|
|
ret = stat(filename.c_str(), &sb); |
|
|
|
ret = stat(filename.c_str(), &sb); |
|
|
|
} while (ret != 0 && errno == EINTR); |
|
|
|
} while (ret != 0 && errno == EINTR); |
|
|
|
#ifdef _WIN32 |
|
|
|
if (sb.st_mode & S_IFDIR) { |
|
|
|
if ((sb.st_mode & _S_IFMT) == _S_IFREG) { |
|
|
|
last_error_message_ = "Input file is a directory."; |
|
|
|
#else |
|
|
|
|
|
|
|
if (!S_ISREG(sb.st_mode)) { |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
last_error_message_ = "Input file is not a regular file."; |
|
|
|
|
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
int file_descriptor; |
|
|
|
int file_descriptor; |
|
|
|