From 5cfae636206df6f6f36d004f7dc66bcfb6d4a52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Tue, 10 Jun 2014 23:15:04 +0200 Subject: Create thumbnail cache dir automatically --- util.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index c611da4..4e48f17 100644 --- a/util.c +++ b/util.c @@ -324,14 +324,8 @@ int r_mkdir(const char *path) if (path == NULL || *path == '\0') return -1; - if (stat(path, &stats) == 0) { - if (S_ISDIR(stats.st_mode)) { - return 0; - } else { - warn("not a directory: %s", path); - return -1; - } - } + if (stat(path, &stats) == 0) + return S_ISDIR(stats.st_mode) ? 0 : -1; d = dir = (char*) s_malloc(strlen(path) + 1); strcpy(dir, path); @@ -346,7 +340,6 @@ int r_mkdir(const char *path) err = -1; } } else if (stat(dir, &stats) < 0 || !S_ISDIR(stats.st_mode)) { - warn("not a directory: %s", dir); err = -1; } if (d != NULL) -- cgit v1.2.3