if (flags & O_CREAT) {
snprintf(fname, PATH_MAX, "%s%s", node_path, key_dir);
- if (mkdir(fname, 0755) != 0)
+ if (mkdir(fname, 0755) != 0 && errno != EEXIST)
l_error("Failed to create dir(%d): %s", errno, fname);
}
/* Make sure path exists */
snprintf(path, PATH_MAX, "%s%s", node_path, rpl_dir);
- if (mkdir(path, 0755) != 0)
+ if (mkdir(path, 0755) != 0 && errno != EEXIST)
l_error("Failed to create dir(%d): %s", errno, path);
dir = opendir(path);
return false;
snprintf(path, PATH_MAX, "%s%s", node_path, rpl_dir);
- if (mkdir(path, 0755) != 0)
+ if (mkdir(path, 0755) != 0 && errno != EEXIST)
l_error("Failed to create dir(%d): %s", errno, path);
return true;
}
}
strncat(dir, prev + 1, next - prev);
- if (mkdir(dir, 0755) != 0)
+ if (mkdir(dir, 0755) != 0 && errno != EEXIST)
l_error("Failed to create dir(%d): %s", errno, dir);
prev = next;
}
- if (mkdir(dir_name, 0755) != 0)
+ if (mkdir(dir_name, 0755) != 0 && errno != EEXIST)
l_error("Failed to create dir(%d): %s", errno, dir_name);
return 0;