Age | Commit message (Collapse) | Author |
|
Let's clean up our tree a bit, and reduce invocations of the
thread-unsafe strerror() by replacing it with printf()'s %m specifier.
|
|
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers.
|
|
Don't clobber the sd_device struct, and don't leak memory when memory allocation fails.
|
|
In device_update_properties_bufs(), the strv is built from pointers into the
single nul-terminated buf_nulstr string, to avoid allocating the key=value
strings twice. However, we must not do that while building and
GREEDY_REALLOC0()'ing buf_nulstr, as each time when this actually reallocates
memory the pointers we wrote into buf_strv so far become invalid.
So change the logic to first completely build the new buf_nulstr, and then
iterate over it to pick out the pointers to the individual key=value strings
for properties_strv.
This fixes invalid environment for udev callouts.
|
|
A NULL pointer was inserted as the first element of the strv.
This had the effect of always passing the empty environment to processes
spawned by udev.
Reported by Michał Bartoszkiewicz.
|
|
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>.
|
|
I shall not use alloca() within loops
I shall not use alloca() within loops
I shall not use alloca() within loops
I shall not use alloca() within loops
...
|
|
|
|
Use the standard FOREACH_WORD* macros.
The current code was broken in the devlink case so the last one received
was being dropped, causing https://bugs.freedesktop.org/show_bug.cgi?id=89894
|
|
unnecessarily
|
|
This provides equivalent functionality to libudev-device, but in the
systemd style. The public API only caters to creating sd_device objects
from for devices that already exist in /sys, there is no support for
listening for monitoring events or creating devices received over
the udev netlink protocol.
The private API contains the necessary functionality to make sd-device
a drop-in replacement for libudev-device, but which we would not
otherwise want to export.
|