Age | Commit message (Collapse) | Author |
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The data comes from the kernel, so chances of it being
garbled are low, but for correctness' sake, add the check.
CID #996458.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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>
|
|
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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This will allow us to clean up the device when we are notified about the worker being killed.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This allows us to move the db reading from udevd to libudev.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
To copy properties from one device to another. Drop the equivalent functionality from udevd.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This should have been committed with
udev_device_add_property - implicitly mark properties for saving to db
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Note: We also ported touch() and touch_file() from upstream. -AGB.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
|
|
|
|
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>
|
|
|
|
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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Types used for pids and uids in various interfaces are unpredictable.
Too bad.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
There is no reason to keep both separated. We want to avoid API specific
tools and instead keep generic terms like 'input'.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Make sure we properly validate the return value of
udev_device_get_sysattr_value(). It might be NULL for several reasons.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1178051
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
various other tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
There is alot of cleanup that will have to happen to turn on
-fstrict-aliasing, but I think our code should be "correct" to the rule.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Bump libblkid requirement from 2.20 to 2.24.
util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Let's add some syntactic sugar for iterating through inotify events, and
use it everywhere.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This patch changes the naming scheme for sas disks. The original names used
disk's sas address and lun, the new scheme uses sas address of the
nearest expander (if available) and a phy id of the used connection.
If no expander is used, the phy id of hba phy is used.
Note that names that refer to RAID or other abstract devices are
unchanged.
Name in raid configuration:
hba_pci_address-sas-raid_sas_address-lunY-partZ
Name in expander bare disk configuration:
hba_pci_address-sas-expander_sas_address-phyX-lunY-partZ
Name format without expanders:
hba_pci_address-sas-phyX-lunY-partZ
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Also accept '\r' as newline character.
This dropps warnings of the type:
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('')
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The current code would print the character following the first invalid
character.
Given an udev rules-file without a trailing newline we would otherwise print
garbage:
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('m')
This is now changed to print
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('')
(still not very good as printing \0 just gives the empty string)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Currently a property in the form of
FOO=bar
is stored as " FOO=bar", i.e. the property name contains a leading space.
That's quite hard to spot.
This patch discards all extra whitespaces but the first one which is required
by libudev's hwdb_add_property.
[zj: modify the check a bit]
https://bugs.freedesktop.org/show_bug.cgi?id=82311
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|