diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-07-03 18:40:38 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-07-04 04:12:06 +0200 |
commit | 9cc94b15223d158ad618a9b05210a7eb8f748007 (patch) | |
tree | 1ea2d3a116ff0d024e4e627d58f2b0008802de4c /libudev/libudev-monitor.c | |
parent | fc8933f7f65d52d91f502dae778609242cdf3492 (diff) |
libudev: monitor - handle kernel supplied DEVNAME properly
Diffstat (limited to 'libudev/libudev-monitor.c')
-rw-r--r-- | libudev/libudev-monitor.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c index e8cdd30a16..2c6c685c6b 100644 --- a/libudev/libudev-monitor.c +++ b/libudev/libudev-monitor.c @@ -504,7 +504,6 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito int action_set = 0; int maj = 0; int min = 0; - int is_kernel = 0; retry: if (udev_monitor == NULL) @@ -545,10 +544,10 @@ retry: } } else if (snl.nl_groups == UDEV_MONITOR_KERNEL) { if (snl.nl_pid > 0) { - info(udev_monitor->udev, "multicast kernel netlink message from pid %d ignored\n", snl.nl_pid); + info(udev_monitor->udev, "multicast kernel netlink message from pid %d ignored\n", + snl.nl_pid); return NULL; } - is_kernel = 1; } } @@ -590,9 +589,8 @@ retry: } udev_device = udev_device_new(udev_monitor->udev); - if (udev_device == NULL) { + if (udev_device == NULL) return NULL; - } while (bufpos < buflen) { char *key; @@ -616,10 +614,10 @@ retry: } else if (strncmp(key, "DEVTYPE=", 8) == 0) { udev_device_set_devtype(udev_device, &key[8]); } else if (strncmp(key, "DEVNAME=", 8) == 0) { - if (is_kernel) - udev_device_set_knodename(udev_device, &key[8]); - else + if (key[8] == '/') udev_device_set_devnode(udev_device, &key[8]); + else + udev_device_set_knodename(udev_device, &key[8]); } else if (strncmp(key, "DEVLINKS=", 9) == 0) { char devlinks[UTIL_PATH_SIZE]; char *slink; |