Rename mkdir_p -> udev_mkdir_p to avoid symbol collisions.

While usptream doesn't support a static libudev.a, we will try to
do so.  However, mkdir_p() is used in lvm2 and util-linux, so
to avoid the collision, we rename it to udev_mkdir_p().  See:

https://bugs.gentoo.org/show_bug.cgi?id=520450

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
Anthony G. Basile 2015-06-18 14:11:59 -04:00
parent 52a4d0c0d5
commit 5e11fe2da4
4 changed files with 4 additions and 4 deletions

View File

@ -124,6 +124,6 @@ int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkdir_fu
return 0;
}
int mkdir_p(const char *path, mode_t mode) {
int udev_mkdir_p(const char *path, mode_t mode) {
return mkdir_p_internal(NULL, path, mode, mkdir);
}

View File

@ -21,7 +21,7 @@
#include <sys/types.h>
int mkdir_parents(const char *path, mode_t mode);
int mkdir_p(const char *path, mode_t mode);
int udev_mkdir_p(const char *path, mode_t mode);
/* mandatory access control(MAC) versions */
int mkdir_parents_label(const char *path, mode_t mode);

View File

@ -2682,7 +2682,7 @@ int udev_rules_apply_static_dev_perms(struct udev_rules *rules) {
_cleanup_free_ char *unescaped_filename = NULL;
strscpyl(tags_dir, sizeof(tags_dir), UDEV_ROOT_RUN "/udev/static_node-tags/", *t, "/", NULL);
r = mkdir_p(tags_dir, 0755);
r = udev_mkdir_p(tags_dir, 0755);
if (r < 0)
return log_error_errno(r, "failed to create %s: %m", tags_dir);

View File

@ -1301,7 +1301,7 @@ int main(int argc, char *argv[]) {
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
if (access(UDEV_ROOT_RUN "/udev/rules.d", F_OK) < 0) {
mkdir_p(UDEV_ROOT_RUN "/udev/rules.d", 0755);
udev_mkdir_p(UDEV_ROOT_RUN "/udev/rules.d", 0755);
}
inotify_add_watch(fd_inotify, UDEV_ROOT_RUN "/udev/rules.d",
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);