Navigation Menu

Skip to content

Commit

Permalink
solaris: use stat() instead of dirent.d_type
Browse files Browse the repository at this point in the history
Reported by Kazuhiko Shiozaki. Thanks!!!
  • Loading branch information
kou committed Mar 19, 2012
1 parent bbe942f commit db8d4b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ha_mroonga.cc
Expand Up @@ -7152,7 +7152,11 @@ void ha_mroonga::remove_grn_obj_force(const char *name)
DIR *dir = opendir(".");
if (dir) {
while (struct dirent *entry = readdir(dir)) {
if (entry->d_type != DT_REG) {
struct stat file_status;
if (stat(entry->d_name, &file_status) != 0) {
continue;
}
if (!((file_status.st_mode & S_IFMT) && S_IFREG)) {
continue;
}
if (strncmp(entry->d_name, path, path_length) == 0) {
Expand Down

0 comments on commit db8d4b9

Please sign in to comment.