]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: fix mkdir_p() implementation
authorVincent Bernat <vincent@bernat.ch>
Sun, 21 Mar 2021 14:41:41 +0000 (15:41 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sun, 21 Mar 2021 14:41:41 +0000 (15:41 +0100)
src/daemon/priv.c

index 7810f16b3f9170e638245fbae82f8432f20d0574..e4ae6eca9de81d34fd4c8c0046afb32c28e33d20 100644 (file)
@@ -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 = '/';
        }