diff options
author | Kay Sievers <kay@vrfy.org> | 2012-04-17 00:26:02 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-04-17 01:09:39 +0200 |
commit | 9e13dbae509605dba1bde7e7385086b59acb428e (patch) | |
tree | ab3b5cdbdcf358212727f2aa181186d4b5973832 /src/libudev/libudev-device-private.c | |
parent | f13b388f97bc3ba8db844bd3413d510e2466a0b6 (diff) |
udev: replace util_create_path() with mkdir_parents()
Diffstat (limited to 'src/libudev/libudev-device-private.c')
-rw-r--r-- | src/libudev/libudev-device-private.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index a4dfa9bd39..2c50e174c6 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -25,7 +25,6 @@ static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) { const char *id; - struct udev *udev = udev_device_get_udev(dev); char filename[UTIL_PATH_SIZE]; id = udev_device_get_id_filename(dev); @@ -36,7 +35,7 @@ static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) if (add) { int fd; - util_create_path(udev, filename); + mkdir_parents(filename, 0755); fd = open(filename, O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444); if (fd >= 0) close(fd); @@ -96,9 +95,9 @@ static bool device_has_info(struct udev_device *udev_device) int udev_device_update_db(struct udev_device *udev_device) { + struct udev *udev = udev_device_get_udev(udev_device); bool has_info; const char *id; - struct udev *udev = udev_device_get_udev(udev_device); char filename[UTIL_PATH_SIZE]; char filename_tmp[UTIL_PATH_SIZE]; FILE *f; @@ -120,7 +119,7 @@ int udev_device_update_db(struct udev_device *udev_device) /* write a database file */ util_strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL); - util_create_path(udev, filename_tmp); + mkdir_parents(filename_tmp, 0755); f = fopen(filename_tmp, "we"); if (f == NULL) { err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp); |