summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-device.c
AgeCommit message (Collapse)Author
2015-07-20sd-device: get_subsystem - don't complain if a device does not have a subsystemTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-06-18udevd: fix REMOVE handlingChris Clayton
The original upstream commit is at http://cgit.freedesktop.org/systemd/systemd/commit/?id=107f2e2526d476c6cc9b81a690391c111027d641 This was reworked by Chris Clayton for eudev. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-27Remove hardcoded path /run and configure using --with-rootrundir=David Cortarello
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen
This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev: downgrade "has devpath" and "filled with db file" messagesZbigniew Jędrzejewski-Szmek
Udev debug messages have to be significantly overhauled... For now just downgrade those two. They are responsible for approximately 25% of debug output during boot and are rather useless. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev: make set_usec_initialized() internal to libudevTom Gundersen
Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise sets it to now(CLOCK_MONOTONIC). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: introduce clone_with_db()Tom Gundersen
This allows us to move the db reading from udevd to libudev. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: introduce udev_device_properties_copy()Tom Gundersen
To copy properties from one device to another. Drop the equivalent functionality from udevd. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: private - make property_from_string_parse* staticTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: udev_device_read_db - drop unused argumentTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: udev_device_add_property - implicitly mark properties for saving to dbTom Gundersen
Note: We also ported touch() and touch_file() from upstream. -AGB. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudevTom Gundersen
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11Minor cleanupsAnthony G. Basile
2015-02-11libudev: private - drop some functions from the internal APITom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11udev: event - move renaming of udev_device to libudevTom Gundersen
This is not exposed in the public API. We want to simplify the internal libudev-device API as much as possible so that it will be simpler to rip the whole thing out in the future. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08libudev: monitor - move nulstr parsing to libudev-deviceTom Gundersen
Hide the details a bit. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08udev: event - introduce and use internal udev_device_shallow_clone()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17use correct format typesThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04libudev: set errno properly in all error conditions of ↵Lennart Poettering
udev_device_new_from_syspath() Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-30treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: switch to systemd logging functionsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: fix path for database names on 'change' eventRobert Milasan
If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-13udev: allow removing tags via TAG-="foobar"David Herrmann
This extends the udev parser to support OP_REMOVE (-=) and adds support for TAG-= to remove previously set tags. We don't fail if the tag didn't exist. This is pretty handy if we ship default rules for seat-assignments and users want to exclude specific devices from that. They can easily add rules that drop any automatically added "seat" tags again. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04libudev: set errno when udev_device_new_from_* or udev_device_get_parent_* failTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-15Remove unnecessary casts in printfsZbigniew Jedrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-21everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-02use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09libudev: devices received from udev are always initializedKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09docs: remove unneeded the's in gudev docsZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=72164 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09libudev: always return NULL in _unref() APIsLennart Poettering
Returning anything else but NULL would suggest the caller's reference might still be valid, but it isn't, because the caller just invoked _unref() after all. This turns the return value into a typesafe shortcut that allows unreffing and resetting a reference in one line. In contrast to solutions for this which take a pointer to a pointer to accomplish the same this solution is just syntactic sugar the developer can make use of but doesn't have to, and this is particularly useful when immediately unreffing objects returned by function calls. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09libudev: always return valid negative error codes on API functionsLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09udev: declare some symbols staticKay Sievers
2013-09-10typo fixes in man and commentsThomas Hindoe Paaboel Andersen
2013-07-07Import strxcpyx from upstreamAnthony G. Basile
This commit imports strxcpyx from upstream. This is upstream commit d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d Note: there were also some very minor code cleanups to accelerometer.c: line 187 collect.c: lines 35, 140 libudev-device.c: line 780 libudev-hwdb.c: line 300 These are part of upstream commits: 507f22bd0172bff5e5d98145b1419bd472a2c57f 3cf7b686e6b29f78de0af5929602cae4482f6d49 67410e9f73a6cdd8453c78b966451b5151def14a Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-03src/libudev/libudev-device.c: fix typoAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02libude: remove special handling of "device" link and legacy respecting codeKay Sievers
Remove special handling of device link by Sievers. Remove legacy respecting code by Basile. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02libudev: implement udev_device_set_attribute_value()Hannes Reinecke
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-04Add support for legacy behaviour in udev_device_get_sysattr_value()Ian Stakenvicius
Wraps the changes made in systemd commits 5ae18ddc and 53726349 with a #if's on LIBUDEV_LEGACY_VERSION so that old behaviour can be chosen at build-time if users find it necessary to support legacy software dependent on the original behaviour Original Authors: Kay Sievers Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-02libudev: update to 199Ian Stakenvicius
This updates the library codebase to upstream version 199. (originally merged by Anthony G. Basile <blueness@gentoo.org>) Upstream commits 5ae18ddc0d and 53726349e1 are not applied, code will be excluded via #if...#endif in a future commit Authors: Kay Sievers Thomas Hindoe Paaboel Andersen Hannes Reinecke Jan Engelhardt See http://cgit.freedesktop.org/systemd/systemd/log/src/libudev Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-01-28Honor DEVUID, DEVGID in addition to DEVMODEIan Stakenvicius
New behaviour in udev-197 systemd commit 1edefa4f1d7bae6cc19aa4a97238400c5a04f7a4 Author: Kay Sievers <kay@vrfy.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-15src/libudev: successfully buildsAnthony G. Basile
2012-11-12libudev: update copyright headersKay Sievers
2012-11-12udev: use usec_t and now()Kay Sievers
2012-10-08udev: remove SYMLINK "unique" optionKay Sievers
2012-09-13man: fix a bunch of typos in docsThomas Hindoe Paaboel Andersen
https://bugs.freedesktop.org/show_bug.cgi?id=54501
2012-08-10udev: export udev_device_new_from_device_id()Kay Sievers
2012-07-15udev: get rid of TEST_PREFIX and use unshare() to fake /sys, /dev, /runKay Sievers