4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
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. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file 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. |
c532d8a00cacacc6775effb7aadca680b1d39ccd |
|
15-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
udev: builtin-hwdb - port to sd-hwdb |
0b9315719154fa7ea1a075e1b3785713f5acc3a1 |
|
12-Dec-2014 |
David Herrmann <dh.herrmann@gmail.com> |
hwdb: FOREACH_HWDB_PROPERTY -> SD_HWDB_FOREACH_PROPERTY
Lets not pollute the global namespace. Prefix all our exported names and
macros with SD_HWDB_*. |
8b516fdea74127327b0945bb50690bd70c6b6692 |
|
11-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
libudev: make libudev-hwdb a wrapper around sd-hwdb |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
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. |
ff49bc3212cb07d850dcfd59940539773a0be26f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: drop unnecessary trailing \n in log_*() calls |
25e773eeb4f853804e1bf0dbd9a184f23e9b2a97 |
|
13-Nov-2014 |
Kay Sievers <kay@vrfy.org> |
udev: switch to systemd logging functions |
8232e39e7cf32071e11b3b04839e6c98fbc81d0f |
|
05-Nov-2014 |
Colin Guthrie <colin@mageia.org> |
udev hwdb: Change error message regarding missing hwdb.bin back to debug.
When used in an initramfs, it's expected that the hwdb.bin file is
not present (it makes for a very large initramfs otherwise).
While it's nice to tell the user about this, as it's not strictly
speaking an error we really shouldn't be so forceful in our
reporting. |
33488f19793dc0a86fdee27266c5319b5b78d695 |
|
28-Oct-2014 |
Martin Pitt <martin.pitt@ubuntu.com> |
udev hwdb: Support shipping pre-compiled database in system images
In some cases it is preferable to ship system images with a pre-generated
binary hwdb database, to avoid having to build it at runtime, avoid shipping
the source hwdb files, or avoid storing large binary files in /etc.
So if hwdb.bin does not exist in /etc/udev/, fall back to looking for it in
UDEVLIBEXECDIR. This keeps the possibility to add files to /etc/udev/hwdb.d/
and re-generating the database which trumps the one in /usr/lib.
Add a new --usr flag to "udevadm hwdb --update" which puts the database
into UDEVLIBEXECDIR.
Adjust systemd-udev-hwdb-update.service to not generate the file in /etc if we
already have it in /usr. |
fa1c4b518ec7d8ec2d647213ee651cde4d6c9d7e |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Fix misuse of uint64_t as size_t
They have different size on 32 bit, so they are really not interchangable. |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
85719154e7412de2d84f64b50b6b98b13981b65f |
|
10-Dec-2013 |
Kay Sievers <kay@vrfy.org> |
libudev: hwdb - use libudev not systemd logging |
725d7e6cebcafef3bd4adbf76c8fa73a9b18972e |
|
20-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
libudev: always return NULL in _unref() APIs
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. |
cabaa37a602ea787d3b3d1f6ec402de7918a4823 |
|
15-Aug-2013 |
Kay Sievers <kay@vrfy.org> |
libudev: fix hwdb validation to look for the *new* file |
3cf7b686e6b29f78de0af5929602cae4482f6d49 |
|
01-Jul-2013 |
Kay Sievers <kay@vrfy.org> |
hwdb: remove support for (not fully implemented) conditional properties |
507f22bd0172bff5e5d98145b1419bd472a2c57f |
|
10-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use stdint.h macros instead of casts to print uint64_t values
Casts are visually heavy, and can obscure unwanted truncations. |
beb23689e357ed549f5c9d4a3440da2132a419f1 |
|
07-Feb-2013 |
Kay Sievers <kay@vrfy.org> |
udev: remove HWDB_BIN |
f4443fa5976eca51661947dd4df60847213f27fa |
|
11-Dec-2012 |
Eric Benoit <eric@ecks.ca> |
libudev: hwdb: add missing endianess conversion
https://bugs.freedesktop.org/show_bug.cgi?id=58067 |
ee623f0d0c04a9c8da4953ddc29862c8c4945458 |
|
16-Nov-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hwdb: use $(localstatedir)/lib/udev/hwdb.bin for the binary database
It's not configuration, so it doesn't belong in udev.
Also, remove the catalog when uninstalling udev. |
33c770b174ec77d7da6e7e830e0bca9f74d54367 |
|
15-Nov-2012 |
Kay Sievers <kay@vrfy.org> |
udev: hwdb - properly handle a missing database
On Thu, Nov 15, 2012 at 5:05 PM, Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> wrote:
> Something like this appeared with latest git:
>
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 [387]: Process 364 (systemd-udevd) dumped core.
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] failed while handling '/devices/virtual/net/lo'
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] failed while handling '/devices/pci0000:00/0000:00:03.0/virtio0/net
> Nov 15 16:55:46 fedora-15 [389]: Process 360 (systemd-udevd) dumped core.
>
> Core was generated by usr/lib/systemd/systemd-udevd'.
> Program terminated with signal 11, Segmentation fault.
> #0 0x0000000000423c87 in udev_hwdb_get_properties_list_entry (hwdb=0x0, modalias=0x7fffbcd155f0 |
88a6477ef32ac4c59111f7340525714a6e02e503 |
|
12-Nov-2012 |
Kay Sievers <kay@vrfy.org> |
libudev: update copyright headers |
40fe8b11be9c1a1b38b91db097a5d6ebfa99304c |
|
12-Nov-2012 |
Kay Sievers <kay@vrfy.org> |
udev: use usec_t and now() |
9485d98d7741604c3d728edaed60b02ad63b71df |
|
28-Oct-2012 |
Kay Sievers <kay@vrfy.org> |
libudev: hwdb - cleanup list before getting new properties |
f2d433e178df7df01a836e95775261e1d85ec60d |
|
28-Oct-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Tweak TODO |
2001208c2ab631a69896d1f670c26846b70d1fb7 |
|
27-Oct-2012 |
Kay Sievers <kay@vrfy.org> |
libudev: import hwdb and export lookup interface |