summaryrefslogtreecommitdiff
path: root/src/udev
Commit message (Collapse)AuthorAge
* udev: net_id - improve commentsTom Gundersen2015-04-01
| | | | The dev_port concept is a bit confusing, expand on the comment a bit.
* udev: net_id - support multi-port enpo* device namesTom Gundersen2015-04-01
| | | | | | I'd argue that having firmware labels for such devices makes no sense, but they exist, so make sure we handle them as best as we can.
* udev: net_id - fix copy-paste errorTom Gundersen2015-04-01
| | | | In case pci_slot overflows we were truncating pci_path instead.
* cdrom_id: unroll and simplify data check loopHarald Hoyer2015-03-27
| | | | | | | | | | | also removes this warning: src/udev/cdrom_id/cdrom_id.c: In function ‘cd_media_info.isra.13’: src/udev/cdrom_id/cdrom_id.c:612:12: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow] static int cd_media_info(struct udev *udev, int fd) ^
* fix gcc warnings about uninitialized variablesHarald Hoyer2015-03-27
| | | | | | | | | | | | | like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
* libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen2015-03-18
| | | | This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.
* udev-ctrl: fix strict aliasing issuesShawn Landden2015-03-14
| | | | | | | it is ironic that "The only purpose of this structure is to cast the structure pointer passed in addr in order to avoid compiler warnings. See EXAMPLE below." from bind(2)
* udev: properly calculate size of remaining dataZbigniew Jędrzejewski-Szmek2015-03-13
| | | | | | | The data comes from the kernel, so chances of it being garbled are low, but for correctness' sake, add the check. CID #996458.
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-13
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* udev: make set_usec_initialized() internal to libudevTom Gundersen2015-03-13
| | | | | Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise sets it to now(CLOCK_MONOTONIC).
* udev: dont use EWOULDBLOCKDavid Herrmann2015-03-13
| | | | EWOULDBLOCK is the same as EAGAIN, stop using it.
* udevd: improve handling of failed workerTom Gundersen2015-03-12
| | | | | | The information in the db is stale, so it does not make sense to expose it any longer. Also, don't drop the kernel event, but simply pass it on to userspace without ammending it.
* udevd: don't free event when killing the worker, wait until it has been reapedTom Gundersen2015-03-12
| | | | This will allow us to clean up the device when we are notified about the worker being killed.
* libudev: introduce clone_with_db()Tom Gundersen2015-03-12
| | | | This allows us to move the db reading from udevd to libudev.
* udevd: event - make db loading lazy in REMOVE event handlingTom Gundersen2015-03-12
| | | | | | | | | 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-12
| | | | To copy properties from one device to another. Drop the equivalent functionality from udevd.
* udev: add SYSCTL{} supportKay Sievers2015-03-11
|
* libudev: add missing hunksTom Gundersen2015-03-09
| | | | | This should have been committed with udev_device_add_property - implicitly mark properties for saving to db
* libudev: udev_device_read_db - drop unused argumentTom Gundersen2015-03-09
|
* libudev: udev_device_add_property - implicitly mark properties for saving to dbTom Gundersen2015-03-09
| | | | | | 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-09
| | | | This should be internal to the library as it is only about reflecting the sysfs state in the udev_device.
* udev: simplify event_queue_update() and add debug loggingTom Gundersen2015-03-09
| | | | | | | | This essentially replaces open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444) with open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644), which is ok for our purposes.
* build-sys: add one more Makefile symlinkLennart Poettering2015-03-09
|
* udev: use inttypes.h types wherever appropriateLennart Poettering2015-03-09
|
* tree-wide: use _packed_ macro instead of raw gcc __attribute__Lennart Poettering2015-03-09
|
* udevd: close race in udev settleTom Gundersen2015-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | The udev-settle guarantees that udevd is no longer processing any of the events casued by udev-trigger. The way this works is that it sends a synchronous PING to udevd after udev-trigger has ran, and when that returns it knows that udevd has started processing the events from udev-trigger. udev-settle will then wait for the event queue to empty before returning. However, there was a race here, as we would only update the /run state at the beginning of the event loop, before reading out new events and before processing the ping. That means that if the first uevent arrived in the same event-loop iteration as the PING, we would return the ping before updating the queue state in /run (which would happen on the next iteration). The race window here is tiny (as the /run state would probably get updated before udev-settle got a chance to read /run), but still a possibility. Fix the problem by updating the /run state as the last step before returning the PING. We must still update it at the beginning of the loop as well, otherwise we risk being stuck in poll() with a stale state in /run. Reported-by: Daniel Drake <drake@endlessm.com>
* v4l_id: use standard option parsing loopZbigniew Jędrzejewski-Szmek2015-03-07
| | | | | | | Not terribly important, but the loop wasn't an actual loop, making coverity unhappy. CID #1261725.
* build-sys: generate CLEANFILES from EXTRA_DISTZbigniew Jędrzejewski-Szmek2015-03-04
| | | | | | | | | Everything that is generated can be assumed to belong to CLEANFILES, which means that the original file has to be in EXTRA_DIST. Simplify the rules by generating as in $subject. We have less lists to adjust manually, and 'make clean' actually removes more stuff that before.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | 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.
* shared: introduce cmsg_close_all() callLennart Poettering2015-02-18
| | | | | | | | | The call iterates through cmsg list and closes all fds passed via SCM_RIGHTS. This patch also ensures the call is used wherever appropriate, where we might get spurious fds sent and we should better close them, then leave them lying around.
* include <poll.h> instead of <sys/poll.h>Thomas Hindoe Paaboel Andersen2015-02-12
| | | | | | include-what-you-use automatically does this and it makes finding unnecessary harder to spot. The only content of poll.h is a include of sys/poll.h so should be harmless.
* Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"Lennart Poettering2015-02-12
| | | | | | | This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656. It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw sockets.
* ata_id: remove unused header filesRobert Milasan2015-02-11
| | | | Signed-off-by: Robert Milasan <rmilasan@suse.com>
* net: support globbing and disjunction in Match logicTom Gundersen2015-02-10
| | | | Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches.
* tree-wide: Always use recvmsg with MSG_CMSG_CLOEXECCristian Rodríguez2015-02-10
|
* udev: net_setup - clarify reason for failure of persistent mac address policyTom Gundersen2015-02-06
|
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* udev: event - minor nitTom Gundersen2015-01-26
| | | | | Stay uniform and use 'dev' rather than 'event->dev', as these are aliases (and event->dev looks like it may be a typo for event->dev_db).
* udev: event - introduce and use internal udev_device_shallow_clone()Tom Gundersen2015-01-26
|
* udev: event - move renaming of udev_device to libudevTom Gundersen2015-01-26
| | | | | 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.
* #pragma once here and thereZbigniew Jędrzejewski-Szmek2015-01-23
|
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* udev: merge evdev_id into input_idDavid Herrmann2015-01-15
| | | | | There is no reason to keep both separated. We want to avoid API specific tools and instead keep generic terms like 'input'.
* udev: fix NULL-ptr derefDavid Herrmann2015-01-15
| | | | | Make sure we properly validate the return value of udev_device_get_sysattr_value(). It might be NULL for several reasons.
* udev: make use of new one_zero() helper where appropriateLennart Poettering2015-01-13
|
* udev: link_config - modernize a bit and fix leakesTom Gundersen2015-01-12
| | | | Not all of the link_config struct was getting freed.
* udev: Add builtin/rule to export evdev information as udev propertiesCarlos Garnacho2015-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | This rule is only run on tablet/touchscreen devices, and extracts their size in millimeters, as it can be found out through their struct input_absinfo. The first usecase is exporting device size from tablets/touchscreens. This may be useful to separate policy and application at the time of mapping these devices to the available outputs in windowing environments that don't offer that information as readily (eg. Wayland). This way the compositor can stay deterministic, and the mix-and-match heuristics are performed outside. Conceivably, size/resolution information can be changed through EVIOCSABS anywhere else, but we're only interested in values prior to any calibration, this rule is thus only run on "add", and no tracking of changes is performed. This should only remain a problem if calibration were automatically applied by an earlier udev rule (read: don't). v2: Folded rationale into commit log, made a builtin, set properties on device nodes themselves v3: Use inline function instead of macro for mm. size calculation, use DECIMAL_STR_MAX, other code style issues v4: Made rule more selective v5: Minor style issues, renamed to a more generic builtin, refined rule further.
* udevadm: don't hit an assert when obsolete parameters are passedLennart Poettering2015-01-08
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1178051
* build-sys: add two more missing makefile linksLennart Poettering2015-01-06
|
* udevadm,..: make --help output of udev tools more like the output of the ↵Lennart Poettering2015-01-05
| | | | various other tools