diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-09 14:37:36 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-09 14:37:36 +0200 |
commit | 37372bbc38d8542f482d90b26c90714429584421 (patch) | |
tree | 6d9b5771febda2f97eca3e22a96ac090e0f24337 /udev/lib/libudev-monitor.c | |
parent | 8a4c287d150e56a2bf57163edaee7c487896418f (diff) |
libudev: monitor - add event properties to udev_device
Diffstat (limited to 'udev/lib/libudev-monitor.c')
-rw-r--r-- | udev/lib/libudev-monitor.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c index 5f63d2d401..454a646046 100644 --- a/udev/lib/libudev-monitor.c +++ b/udev/lib/libudev-monitor.c @@ -203,6 +203,8 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito char cred_msg[CMSG_SPACE(sizeof(struct ucred))]; char buf[4096]; size_t bufpos; + int maj = 0; + int min = 0; if (udev_monitor == NULL) return NULL; @@ -279,9 +281,26 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito } if (slink[0] != '\0') device_add_devlink(udev_device, slink); + } else if (strncmp(key, "DRIVER=", 7) == 0) { + device_set_driver(udev_device, &key[7]); + } else if (strncmp(key, "ACTION=", 7) == 0) { + device_set_action(udev_device, &key[7]); + } else if (strncmp(key, "MAJOR=", 6) == 0) { + maj = strtoull(&key[6], NULL, 10); + } else if (strncmp(key, "MINOR=", 6) == 0) { + min = strtoull(&key[6], NULL, 10); + } else if (strncmp(key, "DEVPATH_OLD=", 12) == 0) { + device_set_devpath_old(udev_device, &key[12]); + } else if (strncmp(key, "PHYSDEVPATH=", 12) == 0) { + device_set_physdevpath(udev_device, &key[12]); + } else if (strncmp(key, "SEQNUM=", 7) == 0) { + device_set_seqnum(udev_device, strtoull(&key[7], NULL, 10)); + } else if (strncmp(key, "TIMEOUT=", 8) == 0) { + device_set_timeout(udev_device, strtoull(&key[8], NULL, 10)); } device_add_property(udev_device, key); } + device_set_devnum(udev_device, makedev(maj, min)); return udev_device; } |