mirror of
https://github.com/clearlinux/cve-check-tool.git
synced 2026-10-04 16:08:20 +00:00
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:
+1
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user