summaryrefslogtreecommitdiff
path: root/src/libudev
Commit message (Collapse)AuthorAgeFilesLines
* include sys/sysmacros.h in more placesMike Frysinger2016-03-141-0/+1
| | | | | | Since glibc is moving away from implicitly including sys/sysmacros.h all the time via sys/types.h, include the header directly in more places. This seems to cover most makedev/major/minor usage.
* tree-wide: make ++/-- usage consistent WRT spacingVito Caputo2016-02-221-1/+1
| | | | | | Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
* tree-wide: place #pragma once at the same place everywhereLennart Poettering2016-02-201-2/+2
| | | | | | Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
* libudev: simplify udev_device_ensure_usec_initialized a bitZbigniew Jędrzejewski-Szmek2015-12-071-6/+2
|
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
* tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen2015-11-181-1/+1
| | | | | This is a continuation of the previous include sort patch, which only sorted for .c files.
* tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen2015-11-176-6/+10
|
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-167-13/+9
| | | | Sort the includes accoding to the new coding style.
* treewide: apply errno.cocciMichal Schmidt2015-11-091-4/+2
| | | | with small manual cleanups for style.
* mount-util: move fstype_is_network() and name_to_handle_at() definitions overLennart Poettering2015-10-271-0/+1
|
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-277-2/+9
|
* util-lib: split out syslog-related calls into syslog-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move more file I/O related calls into fileio.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out IO related calls to io-util.[ch]Lennart Poettering2015-10-261-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-253-0/+3
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-249-44/+52
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* tree-wide: remove unused functionsThomas Hindoe Paaboel Andersen2015-10-192-48/+0
|
* tree-wide: use coccinelle to patch a lot of code to use mfree()Lennart Poettering2015-09-091-2/+1
| | | | | | | | | | | | | | This replaces this: free(p); p = NULL; by this: p = mfree(p); Change generated using coccinelle. Semantic patch is added to the sources.
* libudev: device - fix typo in udev_device_get_sysattr_list_entry()Tom Gundersen2015-06-171-1/+1
| | | | We were adding the attributes to the wrong list.
* libudev: enumerate - accept NULL parameters in add_match()Tom Gundersen2015-06-031-0/+21
| | | | This was a regression introduced when moving to sd-device.
* libudev: monitor - set nl_pid when reusing fd in ↵Tom Gundersen2015-06-031-14/+22
| | | | | | | udev_monitor_new_from_netlink_fd This allows a fd to be created and configured as part of one monitor, to be passed in to create a second monitor without having to redo any of the configuration.
* sd-device: get_subsystem - don't complain if a device does not have a subsystemTom Gundersen2015-06-021-1/+2
|
* udevd: manager - move a few global variables into the Manager objectTom Gundersen2015-05-121-1/+0
|
* libudev: monitor - fix typo in log messageTom Gundersen2015-04-291-1/+1
|
* libudev: monitor - clarify log messagesTom Gundersen2015-04-261-2/+2
|
* udevd: fix REMOVE handlingTom Gundersen2015-04-232-0/+7
| | | | | | | | This reverts b67f944. Lazy loading of device properties does not work for devices that are received over netlink, as these are sealed. Reinstate the unconditional loading of the device db. Reported by: Mantas Mikulėnas <grawity@gmail.com>.
* libudev-device: fix lazy loading of devlinks, properties and tagsTom Gundersen2015-04-232-3/+12
| | | | | If the underlying device has not read in the properties yet, the generation will be 0, so make sure we trigger the reading at least once.
* sd-device: enumerator - match only on initialized devices by defaultTom Gundersen2015-04-171-4/+13
| | | | | | | | It is still possible to include uninitialized ones, but now that is opt-in. In most cases people only want initialized devices. Exception is if you want to work without udev running. Suggested by David Herrmann.
* sd-device: enumerator - don't expose add_device()Tom Gundersen2015-04-171-1/+1
| | | | | | | This is rarely, if ever, used. Drop it from the new public API and only keep it for the legacy API. Suggested by David Herrmann.
* libudev: make libudev-enumerate a thin wrapper around sd-deviceTom Gundersen2015-04-162-686/+107
|
* shared: move assert_return_errno() from libudevTom Gundersen2015-04-161-9/+0
| | | | | This should not be used for any new code, as we don't set errno in new code, but there are several legacy users, so let's keep it in shared.
* shared: add formats-util.hRonny Chevalier2015-04-101-0/+1
|
* libudev-util: check length before accesing the arrayThomas Hindoe Paaboel Andersen2015-04-051-1/+1
|
* libudev: device - replace by a thin wrapper around sd-deviceTom Gundersen2015-04-023-1625/+756
|
* libudev: monitor - improve loggingTom Gundersen2015-04-011-2/+8
|
* libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen2015-03-182-15/+45
| | | | This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.
* libudev-monitor: use initializationZbigniew Jędrzejewski-Szmek2015-03-151-17/+16
|
* udev: downgrade "has devpath" and "filled with db file" messagesZbigniew Jędrzejewski-Szmek2015-03-141-2/+2
| | | | | | 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.
* udev: make set_usec_initialized() internal to libudevTom Gundersen2015-03-132-10/+18
| | | | | Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise sets it to now(CLOCK_MONOTONIC).
* libudev: introduce clone_with_db()Tom Gundersen2015-03-122-0/+15
| | | | This allows us to move the db reading from udevd to libudev.
* libudev: monitor - fix error path in send_deviceTom Gundersen2015-03-121-1/+9
| | | | Return -errno rather than -1 in case sendmsg() fails.
* udevd: event - make db loading lazy in REMOVE event handlingTom Gundersen2015-03-121-0/+1
| | | | | | | | | We were explicitly eagerly loading the db, then deletenig the backing file and then processing the rules/symlinks. Instead we delete the backnig db file as the last step and let the db loading be lazy as everywhere else. This may save us a bit of work in casese where the db is not needed, but more importantly it hides some implementation details of libudev-device form udevd.
* libudev: introduce udev_device_properties_copy()Tom Gundersen2015-03-122-0/+16
| | | | To copy properties from one device to another. Drop the equivalent functionality from udevd.
* libudev: udev_device_read_db - drop unused argumentTom Gundersen2015-03-092-24/+21
|
* libudev: udev_device_add_property - implicitly mark properties for saving to dbTom Gundersen2015-03-092-22/+37
| | | | | | Properties should only be saved to the db when added to the udev_device by udevd, and only if the property does not start with a '.'. Make this implicit rather than expose the marking of properties.
* udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudevTom Gundersen2015-03-091-0/+8
| | | | This should be internal to the library as it is only about reflecting the sysfs state in the udev_device.
* libudev: private - make property_from_string_parse* staticTom Gundersen2015-03-092-4/+2
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-238-27/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* Revert "build-sys: re-add old symbols for abi compat"Michal Schmidt2015-02-161-3/+0
| | | | | | | This reverts commit 93a1e66efd4b0f4cda29c467d20d0f7510c0b3a8. It broke the builds for Walters. Kay hates it and "just knows" there are no actual users.