Skip to content

Commit

Permalink
Fix detecting file as directory on zOS issue #8051
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdi-hm authored and acozzette committed Nov 17, 2020
1 parent 0321358 commit a73c8e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/importer.cc
Expand Up @@ -495,7 +495,7 @@ io::ZeroCopyInputStream* DiskSourceTree::OpenDiskFile(
do {
ret = stat(filename.c_str(), &sb);
} while (ret != 0 && errno == EINTR);
if (ret == 0 && sb.st_mode & S_IFDIR) {
if (ret == 0 && S_ISDIR(sb.st_mode)) {
last_error_message_ = "Input file is a directory.";
return NULL;
}
Expand Down

0 comments on commit a73c8e0

Please sign in to comment.