update: Use cve_is_dir() helper

Remove open coded stat() + S_ISDIR() usage with cve_is_dir() helper.

Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
This commit is contained in:
Sergey Popovich
2016-01-20 12:15:37 +00:00
parent 35db7d9e11
commit cfc9048fc9
+1 -3
View File
@@ -90,13 +90,11 @@ cve_string *get_db_path(const char *path)
}
if (mkdir(dir, mode)) {
struct stat st = { .st_ino = 0, };
if (errno != EEXIST) {
return NULL;
}
if (stat(dir, &st) || !S_ISDIR(st.st_mode)) {
if (!cve_is_dir(dir)) {
return NULL;
}
}