chiark / gitweb /
udevadm: test - print list of properties
[elogind.git] / libudev / libudev-device.c
index aef62567341136bdd5d92795a01cbfa2582c48d2..7644e6c63d26ad192b704665d2b835268f03b127 100644 (file)
 #include "libudev.h"
 #include "libudev-private.h"
 
 #include "libudev.h"
 #include "libudev-private.h"
 
+/**
+ * SECTION:libudev-device
+ * @short_description: kernel sys devices
+ *
+ * Representation of kernel sys devices. Devices are uniquely identified
+ * by their syspath, every device has exactly one path in the kernel sys
+ * filesystem. Devices usually belong to a kernel subsystem, and and have
+ * a unique name inside that subsytem.
+ */
+
 /**
  * udev_device:
  *
 /**
  * udev_device:
  *
- * Representation of a kernel sys device.
+ * Opaque object representing one kernel sys device.
  */
 struct udev_device {
        struct udev *udev;
  */
 struct udev_device {
        struct udev *udev;
@@ -582,7 +592,7 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
  * It can be called as many times as needed, without caring about
  * references.
  *
  * It can be called as many times as needed, without caring about
  * references.
  *
- * Returns: a new udev device, or #NULL, if no matching parent exists.
+ * Returns: a new udev device, or #NULL if no matching parent exists.
  **/
 struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
 {
  **/
 struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
 {
@@ -882,7 +892,7 @@ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device
  * udev_device_get_driver:
  * @udev_device: udev device
  *
  * udev_device_get_driver:
  * @udev_device: udev device
  *
- * Returns: the driver string or #NULL, if ther is no driver attached.
+ * Returns: the driver string, or #NULL if there is no driver attached.
  **/
 const char *udev_device_get_driver(struct udev_device *udev_device)
 {
  **/
 const char *udev_device_get_driver(struct udev_device *udev_device)
 {
@@ -951,7 +961,7 @@ unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
  * @udev_device: udev device
  * @sysattr: attribute name
  *
  * @udev_device: udev device
  * @sysattr: attribute name
  *
- * The retrieved value is cached in the device. Repeated reads will return the same
+ * The retrieved value is cached in the device. Repeated calls will return the same
  * value and not open the attribute again.
  *
  * Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value.
  * value and not open the attribute again.
  *
  * Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value.
@@ -1201,14 +1211,20 @@ static int update_envp_monitor_buf(struct udev_device *udev_device)
        s = udev_device->monitor_buf;
        l = MONITOR_BUF_SIZE;
        udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
        s = udev_device->monitor_buf;
        l = MONITOR_BUF_SIZE;
        udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
+               const char *key;
+
+               key = udev_list_entry_get_name(list_entry);
+               /* skip private variables */
+               if (key[0] == '.')
+                       continue;
+
                /* add string to envp array */
                udev_device->envp[i++] = s;
                if (i+1 >= ENVP_SIZE)
                        return -EINVAL;
 
                /* add property string to monitor buffer */
                /* add string to envp array */
                udev_device->envp[i++] = s;
                if (i+1 >= ENVP_SIZE)
                        return -EINVAL;
 
                /* add property string to monitor buffer */
-               l = util_strpcpyl(&s, l, udev_list_entry_get_name(list_entry), "=",
-                                 udev_list_entry_get_value(list_entry), NULL);
+               l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL);
                if (l == 0)
                        return -EINVAL;
                s++;
                if (l == 0)
                        return -EINVAL;
                s++;