aboutsummaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2015-05-25 00:22:33 +0200
committerTharre <tharre3@gmail.com>2015-05-25 00:22:33 +0200
commit2d8f3c34f30ca6930b5e0314eaa49c2bf6c09219 (patch)
treeef744ed5a7321f9d02e174faec75e1be154f5662 /src/filepath.c
parentcdb21f05a7a3e156e339c19a4309b9d7878b83ec (diff)
downloadredo-2d8f3c34f30ca6930b5e0314eaa49c2bf6c09219.tar.gz
redo-2d8f3c34f30ca6930b5e0314eaa49c2bf6c09219.tar.xz
redo-2d8f3c34f30ca6930b5e0314eaa49c2bf6c09219.zip
Small rename and code simplification
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 349b525..2186881 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -119,9 +119,8 @@ void mkpath(char *path, mode_t mode) {
for (p=strchr(path+1, '/'); p; p=strchr(p+1, '/')) {
*p = '\0';
- if (mkdir(path, mode) == -1)
- if (errno != EEXIST)
- fatal("redo: failed to mkdir() '%s'", path);
+ if (mkdir(path, mode) == -1 && errno != EEXIST)
+ fatal("redo: failed to mkdir() '%s'", path);
*p = '/';
}