index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-03-01 13:39:43 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-01 13:39:43 -0600 |
commit | b12be99c8925e758554076c87294b4af10ebf05e (patch) | |
tree | ea06116e3fcb5933dad83ebb91a006fa71a77410 | |
parent | 09ce8b446c01e59a0eb0523846ce6f339ef25fa5 (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 22 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 848ecc58..c3461b77 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -351,18 +351,22 @@ static int checkdbdir(pmdb_t *db) static int is_dir(const char *path, struct dirent *entry) { #ifdef HAVE_STRUCT_DIRENT_D_TYPE - return(entry->d_type == DT_DIR); -#else - char buffer[PATH_MAX]; - snprintf(buffer, PATH_MAX, "%s/%s", path, entry->d_name); + if(entry->d_type != DT_UNKNOWN) { + return(entry->d_type == DT_DIR); + } +#endif + { + char buffer[PATH_MAX]; + struct stat sbuf; + + snprintf(buffer, PATH_MAX, "%s/%s", path, entry->d_name); - struct stat sbuf; - if (!stat(buffer, &sbuf)) { - return(S_ISDIR(sbuf.st_mode)); + if (!stat(buffer, &sbuf)) { + return(S_ISDIR(sbuf.st_mode)); + } } return(0); -#endif } static int local_db_populate(pmdb_t *db) @@ -462,7 +466,7 @@ static int local_db_populate(pmdb_t *db) } /* add to the collection */ - _alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n", + _alpm_log(PM_LOG_DEBUG, "adding '%s' to package cache for db '%s'\n", pkg->name, db->treename); db->pkgcache = _alpm_pkghash_add(db->pkgcache, pkg); count++; |