From cfc9048fc93cb438cf586d217ef257435e8be089 Mon Sep 17 00:00:00 2001 From: Sergey Popovich Date: Wed, 20 Jan 2016 10:57:18 +0000 Subject: [PATCH] update: Use cve_is_dir() helper Remove open coded stat() + S_ISDIR() usage with cve_is_dir() helper. Signed-off-by: Sergey Popovich --- src/update.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/update.c b/src/update.c index 5f9b392..1487645 100644 --- a/src/update.c +++ b/src/update.c @@ -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; } }