summaryrefslogtreecommitdiff
path: root/udev/udev-node.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-05-04 04:52:31 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-05-04 04:52:31 +0200
commitcb14f4543a941ff8a22ef2725df86b3b0190a189 (patch)
tree76de627af3c20265971df6ac1619fb6f26e35171 /udev/udev-node.c
parent9379b7c16dd3b2f11d9e69c063706037ae001a0a (diff)
handle devtmpfs nodes
UDev follows the kernel given name, and re-uses the kernel created device node. If the kernel and spcecified udev rules disagree, the udev specified node node is created and the kernel-created on is deleted.
Diffstat (limited to 'udev/udev-node.c')
-rw-r--r--udev/udev-node.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/udev/udev-node.c b/udev/udev-node.c
index 322e0b88de..2f9cf4d7ac 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -68,7 +68,6 @@ static int name_index(struct udev *udev, const char *devpath, const char *name,
int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mode_t mode, uid_t uid, gid_t gid)
{
struct udev *udev = udev_device_get_udev(dev);
- char filename[UTIL_PATH_SIZE];
struct stat stats;
int preserve = 0;
int err = 0;
@@ -81,14 +80,8 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod
else
mode |= S_IFCHR;
- if (file == NULL) {
+ if (file == NULL)
file = udev_device_get_devnode(dev);
- } else if (file[0] != '/') {
- util_strlcpy(filename, udev_get_dev_path(udev), sizeof(filename));
- util_strlcat(filename, "/", sizeof(filename));
- util_strlcat(filename, file, sizeof(filename));
- file = filename;
- }
if (lstat(file, &stats) == 0) {
if (((stats.st_mode & S_IFMT) == (mode & S_IFMT)) && (stats.st_rdev == devnum)) {