Message ID | a25b924220a1a30348f995a4a7eaa8bcea20f862.1614016514.git.aclaudi@redhat.com |
---|---|
State | New |
Headers | show |
Series | [iproute2,v2,1/2] lib/fs: avoid double call to mkdir on make_path() | expand |
diff --git a/lib/fs.c b/lib/fs.c index 4b90a704..2ae506ec 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -253,7 +253,7 @@ int make_path(const char *path, mode_t mode) *delim = '\0'; rc = mkdir(dir, mode); - if (mkdir(dir, mode) != 0 && errno != EEXIST) { + if (rc && errno != EEXIST) { fprintf(stderr, "mkdir failed for %s: %s\n", dir, strerror(errno)); goto out;