From: Vincent Bernat Date: Sun, 21 Mar 2021 14:41:41 +0000 (+0100) Subject: daemon: fix mkdir_p() implementation X-Git-Tag: 1.0.9~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f05dfc69dcae98e2feb1c14745231400868f1d6b;p=thirdparty%2Flldpd.git daemon: fix mkdir_p() implementation --- diff --git a/src/daemon/priv.c b/src/daemon/priv.c index 7810f16b..e4ae6eca 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -533,7 +533,7 @@ static int mkdir_p(const char *pathname, mode_t mode) for (current = path + 1; *current; current++) { if (*current != '/') continue; *current = '\0'; - if (mkdir(current, mode) != 0 && errno != EEXIST) + if (mkdir(path, mode) != 0 && errno != EEXIST) return -1; *current = '/'; }