X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Flocale-root.c;h=fa620feef3d8b0e6bf90f3ce88df2d6b96ed2ae1;hb=043c27c3a8fd323d59e41288b6fd24f0e9bfa9a3;hp=c9cdf7ddd5e257ee99dc626d19e461467462358b;hpb=15059fa1ed5f94c3b5d96357c9be6adfa5ea37b0;p=src%2Fapp-framework-binder.git diff --git a/src/locale-root.c b/src/locale-root.c index c9cdf7dd..fa620fee 100644 --- a/src/locale-root.c +++ b/src/locale-root.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright (C) 2015-2019 "IoT.bzh" author: José Bollo @@ -146,7 +146,7 @@ static struct locale_folder *search_folder(struct locale_container *container, c return f; if (c >= 0) high = mid; - else + else low = mid + 1; } return NULL; @@ -157,7 +157,7 @@ static struct locale_folder *search_folder(struct locale_container *container, c */ static int init_container(struct locale_container *container, int dirfd) { - int rc, sfd; + int rc = 0, sfd; DIR *dir; struct dirent *dent; struct stat st; @@ -193,7 +193,8 @@ static int init_container(struct locale_container *container, int dirfd) return -1; break; } - if (dent->d_type == DT_DIR || (dent->d_type == DT_UNKNOWN && fstatat(sfd, dent->d_name, &st, 0) == 0 && S_ISDIR(st.st_mode))) { + rc = fstatat(sfd, dent->d_name, &st, 0); + if (rc == 0 && S_ISDIR(st.st_mode)) { /* directory aka folder */ if (dent->d_name[0] == '.' && (dent->d_name[1] == 0 || (dent->d_name[1] == '.' && dent->d_name[2] == 0))) { /* nothing to do for special directories, basic detection, improves if needed */