summaryrefslogtreecommitdiffstats
path: root/src/libudev/libudev-device.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: make sure net/if.h is included before any linux/ headerFrantisek Sumsal2024-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The linux/ headers include linux/libc-compat.h that makes sure the linux/ headers won't redeclare symbols already declared by net/if.h, but glibc's net/if.h doesn't do that, so if the include order is reversed we'll end up with a bunch of errors about redeclared stuff: [3/519] Compiling C object test-network-tables.p/src_network_test-network-tables.c.o FAILED: test-network-tables.p/src_network_test-network-tables.c.o cc -Itest-network-tables.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -Isrc/libsystemd-network -I../src/libsystemd-network -Isrc/network -I../src/network -I../src/network/netdev -I../src/network/tc -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -DTEST_CODE=1 -MD -MQ test-network-tables.p/src_network_test-network-tables.c.o -MF test-network-tables.p/src_network_test-network-tables.c.o.d -o test-network-tables.p/src_network_test-network-tables.c.o -c ../src/network/test-network-tables.c In file included from ../src/basic/linux/if_bonding.h:47, from ../src/network/netdev/bond.h:5, from ../src/network/test-network-tables.c:3: ../src/basic/linux/if.h:111:41: error: redeclaration of enumerator ‘IFF_UP’ 111 | #define IFF_UP IFF_UP | ^~~~~~ ../src/basic/linux/if.h:84:9: note: previous definition of ‘IFF_UP’ with type ‘enum net_device_flags’ 84 | IFF_UP = 1<<0, /* sysfs */ | ^~~~~~ ../src/basic/linux/if.h:112:41: error: redeclaration of enumerator ‘IFF_BROADCAST’ 112 | #define IFF_BROADCAST IFF_BROADCAST | ^~~~~~~~~~~~~ ... This also drops remaining workarounds from the last time this issue was brought up (6f270e6bd8) since they shouldn't be needed anymore if the order of the includes is the "correct" one. I also added a comment to each affected include when this is inevitably encountered again in the future. Resolves: #32160
* device-util: Declare iterator variables inlineDaan De Meyer2023-07-121-10/+0
|
* libudev: fix typo in docstringZbigniew Jędrzejewski-Szmek2021-02-251-1/+1
|
* sd-device: add sd_device_get_action() + sd_device_get_seqnum() + ↵Lennart Poettering2021-02-181-3/+3
| | | | | | | | | | | | | | | | sd_device_new_from_stat_rdev() To make sd-device properly usable for all programs we need to provide an API for the "action" field of an event, it's one of the most relevant ones, and it was so far missing. This also adds sd_device_get_seqnum(), which isn't that interesting, except for generating pretty debug output, which we use it ourselves for. This also makes device_new_from_stat_rdev() public, as it is truly useful, as we can see in our own uses of it, and I think is fairly generic to show up in the public APIs.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* libudev: also expose API to check for current tags in libudevLennart Poettering2020-09-011-15/+47
|
* libudev: Update list of possible actionsBastien Nocera2019-07-231-2/+2
| | | | Add "move" action as per src/libsystemd/sd-device/device-private.c
* libudev: hide definition of struct udev_deviceYu Watanabe2019-06-121-0/+37
|
* libudev: hide definition of struct udev_list from other libudev componentsYu Watanabe2019-06-121-21/+34
| | | | | In the later commit, udev_list will be just a wrapper of hashmap or LIST. So, allocating udev_list does not increase much cost.
* libudev: use device_get_seqnum() and device_get_action()Yu Watanabe2019-03-111-20/+7
|
* libudev: drop unnecessary checkZbigniew Jędrzejewski-Szmek2018-11-231-2/+0
| | | | sd_device_get_subsystem returns -ENOENT if subsystem is not set.
* libudev: do not ignore error in udev_list_entry_add()Yu Watanabe2018-11-221-4/+8
|
* libudev: introduce return_with_errno() and use it where applicableYu Watanabe2018-11-221-102/+58
|
* libudev-list: drop unused udev argument from udev_list_init()Yu Watanabe2018-11-221-4/+4
|
* libudev-list: move libudev-list related definitions to libudev-list-internal.hYu Watanabe2018-11-201-1/+1
| | | | | This also rename libudev-private.h to libudev-util.h, and cleanups several unnecessary headers from udev.h and libudev-util.h
* sd-device: make sd_device_get_is_initialized() returns is_initialized by ↵Yu Watanabe2018-10-291-3/+3
| | | | return value
* sd-device: make sd_device_get_*() return -ENOENT if the values are not setYu Watanabe2018-09-231-3/+6
|
* sd-device,libudev: make an argument for *_set_sysattr_value() constYu Watanabe2018-09-111-1/+1
|
* libudev-device: create sd_device at first in udev_device_new_from_*()Yu Watanabe2018-09-111-52/+22
|
* libudev-device: coding style fixesYu Watanabe2018-09-111-55/+27
|
* libudev-device: fix return value of udev_device_has_tag()Yu Watanabe2018-09-111-3/+2
|
* libudev-device: use original negative errnoYu Watanabe2018-09-111-1/+1
|
* libudev-device: use structured initializerYu Watanabe2018-09-111-3/+7
|
* libudev: use DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC() macro where applicableYu Watanabe2018-09-111-24/+16
|
* libudev: accept NULL as the argument 'struct udev*' for udev_monitor_new() ↵Yu Watanabe2018-08-221-2/+0
| | | | | | | or friends As udev_monitor struct or friends are now almost independent of udev struct. So, generating these objects without udev struct is reasonable.
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-4/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-2/+2
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tree-wide: use "cannot" instead of "can not"Zbigniew Jędrzejewski-Szmek2018-02-081-2/+2
| | | | This is the usual spelling, and a bit shorter.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* libudev: fix typo in commentPeter Hutterer2016-08-191-1/+1
|
* treewide: fix typos and remove accidental repetition of wordsTorstein Husebø2016-07-111-1/+1
|
* tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen2015-11-171-1/+1
|
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-1/+1
| | | | Sort the includes accoding to the new coding style.
* util-lib: split out allocation calls into alloc-util.[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 our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-14/+14
| | | | | | | | | | | | | | 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.
* 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.
* sd-device: get_subsystem - don't complain if a device does not have a subsystemTom Gundersen2015-06-021-1/+2
|
* libudev-device: fix lazy loading of devlinks, properties and tagsTom Gundersen2015-04-231-3/+9
| | | | | 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.
* libudev: device - replace by a thin wrapper around sd-deviceTom Gundersen2015-04-021-1480/+328
|
* libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen2015-03-181-12/+44
| | | | This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.
* udev: downgrade "has devpath" and "filled with db file" messagesZbigniew Jędrzejewski-Szmek2015-03-151-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-131-9/+17
| | | | | 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-121-0/+14
| | | | This allows us to move the db reading from udevd to libudev.
* libudev: introduce udev_device_properties_copy()Tom Gundersen2015-03-121-0/+15
| | | | To copy properties from one device to another. Drop the equivalent functionality from udevd.
* libudev: udev_device_read_db - drop unused argumentTom Gundersen2015-03-091-23/+20
|
* libudev: udev_device_add_property - implicitly mark properties for saving to dbTom Gundersen2015-03-091-21/+36
| | | | | | 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.