chiark / gitweb /
libudev: add udev_device_get_syspath()
[elogind.git] / udev / lib / libudev-monitor.c
index 025ce7f0efcb8dac0ee89f0585524fd292d01703..92617e8888b3a12d583c2d920bc3824689b69eaa 100644 (file)
@@ -146,7 +146,7 @@ void udev_monitor_unref(struct udev_monitor *udev_monitor)
  * udev_monitor_get_udev:
  * @udev_monitor: udev monitor
  *
- * Retrieve the udev library context the device was created with.
+ * Retrieve the udev library context the monitor was created with.
  *
  * Returns: the udev library context
  **/
@@ -177,10 +177,10 @@ int udev_monitor_get_fd(struct udev_monitor *udev_monitor)
  * @udev_monitor: udev monitor
  *
  * Retrieve data from the udev monitor socket, allocate a new udev
- * device, and fill in the received data, and return the device.
+ * device, fill in the received data, and return the device.
  *
  * Only socket connections with uid=0 are accepted. The caller
- * need to make sure, that there is data to read from the socket,
+ * needs to make sure, that there is data to read from the socket,
  * the call will block until the socket becomes readable.
  *
  * The initial refcount is 1, and needs to be decremented to
@@ -257,25 +257,25 @@ struct udev_device *udev_monitor_get_device(struct udev_monitor *udev_monitor)
                bufpos += keylen + 1;
 
                if (strncmp(key, "DEVPATH=", 8) == 0) {
-                       udev_device->devpath = strdup(&key[8]);
+                       device_set_devpath(udev_device, &key[8]);
                } else if (strncmp(key, "SUBSYSTEM=", 10) == 0) {
-                       udev_device->subsystem = strdup(&key[10]);
+                       device_set_subsystem(udev_device, &key[10]);
                } else if (strncmp(key, "DEVNAME=", 8) == 0) {
-                       udev_device->devname = strdup(&key[8]);
+                       device_set_devname(udev_device, &key[8]);
                } else if (strncmp(key, "DEVLINKS=", 9) == 0) {
                        char *slink = &key[9];
                        char *next = strchr(slink, ' ');
 
                        while (next != NULL) {
                                next[0] = '\0';
-                               name_list_add(&udev_device->link_list, slink, 0);
+                               device_add_devlink(udev_device, slink);
                                slink = &next[1];
                                next = strchr(slink, ' ');
                        }
                        if (slink[0] != '\0')
-                               name_list_add(&udev_device->link_list, slink, 0);
+                               device_add_devlink(udev_device, slink);
                }
-               name_list_add(&udev_device->env_list, key, 0);
+               device_add_property(udev_device, key);
        }
 
        return udev_device;