chiark / gitweb /
rules: suse - use NAME for mapper/control
[elogind.git] / libudev / libudev-monitor.c
index e8cdd30a166e2357b1969241263b462ae4ce24e8..657f23d727d1f741a68a7d84423b083da1f3996b 100644 (file)
@@ -336,7 +336,7 @@ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
 
                        /*
                         * get the address the kernel has assigned us
-                        * it is usually, but not neccessarily the pid
+                        * it is usually, but not necessarily the pid
                         */
                        addrlen = sizeof(struct sockaddr_nl);
                        err = getsockname(udev_monitor->sock, (struct sockaddr *)&snl, &addrlen);
@@ -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;
@@ -749,7 +747,7 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor,
                /*
                 * Use custom address for target, or the default one.
                 *
-                * If we send to a muticast group, we will get
+                * If we send to a multicast group, we will get
                 * ECONNREFUSED, which is expected.
                 */
                if (destination != NULL)
@@ -770,7 +768,7 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor,
  * udev_monitor_filter_add_match_subsystem_devtype:
  * @udev_monitor: the monitor
  * @subsystem: the subsystem value to match the incoming devices against
- * @devtype: the devtype value to matvh the incoming devices against
+ * @devtype: the devtype value to match the incoming devices against
  *
  * The filter must be installed before the monitor is switched to listening mode.
  *