Commit graph

67 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 32397af3d4
Merge pull request #9928 from yuwata/libudev-cleanups
libudev: coding style updates
2018-09-15 22:36:38 +02:00
Yu Watanabe a7e9db150b libudev-device: drop prototypes of unexistent functions 2018-09-11 12:45:21 +09:00
Yu Watanabe 536cbd7fa6 libudev: drop a prototype of unexistent function 2018-09-11 12:45:21 +09:00
Yu Watanabe 09f638ebd9 libudev-queue: drop prototypes of nonexistent functions 2018-09-11 12:45:21 +09:00
Yu Watanabe 1544d17f73 libudev-util: adjust type of returned value by util_string_hash32() 2018-09-10 18:27:36 +09:00
Yu Watanabe 755c3fe9a7 libudev-util: drop unnecessary argument 'struct udev *udev' from util_resolve_subsys_kernel() 2018-09-10 18:27:36 +09:00
Yu Watanabe 3782454c41 libudev: introduce udev_monitor_receive_sd_device() 2018-08-23 04:57:39 +09:00
Yu Watanabe 7c7be5515f libudev: move cleanup functions from udev-util.h to libudev-private.h 2018-08-23 04:57:39 +09:00
Yu Watanabe afb76fdbff tree-wide: drop double newline 2018-06-29 11:02:17 +09:00
Zbigniew Jędrzejewski-Szmek d9b02e1697 tree-wide: drop copyright headers from frequent contributors
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
2018-06-20 11:58:53 +02:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
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.
2018-06-14 10:20:21 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
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.
2018-06-14 10:20:20 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
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.
2018-04-06 18:58:55 +02:00
Yu Watanabe 43beb0cf68 udev: use "#pragma once" 2018-02-09 16:33:30 +09:00
Zbigniew Jędrzejewski-Szmek 53e1b68390 Add SPDX license identifiers to source files under the LGPL
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-11-19 19:08:15 +01:00
Lennart Poettering 7546145e26 string-util: add delete_trailing_chars() and skip_leading_chars() helpers
And let's port over a couple of users to the new APIs.
2017-11-13 10:47:15 +01:00
Thomas Hindoe Paaboel Andersen 71d35b6b55 tree-wide: sort includes in *.h
This is a continuation of the previous include sort patch, which
only sorted for .c files.
2015-11-18 23:09:02 +01:00
Lennart Poettering 07630cea1f 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.
2015-10-24 23:05:02 +02:00
Thomas Hindoe Paaboel Andersen b250ea2fd6 tree-wide: remove unused functions 2015-10-19 21:46:01 +02:00
Tom Gundersen ecb17862ad udevd: manager - move a few global variables into the Manager object 2015-05-12 19:16:43 +02:00
Tom Gundersen 107f2e2526 udevd: fix REMOVE handling
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>.
2015-04-23 22:31:25 +02:00
Tom Gundersen bf0e00ec58 libudev: private - introduce udev_device_new_from_synthetic_event()
This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.
2015-03-18 14:49:20 +01:00
Tom Gundersen 1b14c3cfbe udev: make set_usec_initialized() internal to libudev
Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise
sets it to now(CLOCK_MONOTONIC).
2015-03-13 18:47:07 +01:00
Tom Gundersen 8f0f13f045 libudev: introduce clone_with_db()
This allows us to move the db reading from udevd to libudev.
2015-03-12 12:03:50 +01:00
Tom Gundersen 1cd0a77022 libudev: introduce udev_device_properties_copy()
To copy properties from one device to another. Drop the equivalent functionality from udevd.
2015-03-12 11:59:04 +01:00
Tom Gundersen 570b83cc62 libudev: udev_device_read_db - drop unused argument 2015-03-09 23:27:12 +01:00
Tom Gundersen df546eb56a libudev: udev_device_add_property - implicitly mark properties for saving to db
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.
2015-03-09 22:50:44 +01:00
Tom Gundersen bd57b6de74 libudev: private - make property_from_string_parse* static 2015-03-09 22:50:44 +01:00
Tom Gundersen 71ef8b3ac4 libudev: private - drop some functions from the internal API 2015-01-26 14:48:04 +01:00
Tom Gundersen 2df959ec3b libudev: monitor - move nulstr parsing to libudev-device
Hide the details a bit.
2015-01-26 14:45:12 +01:00
Tom Gundersen fa639f3ae7 udev: event - introduce and use internal udev_device_shallow_clone() 2015-01-26 14:12:45 +01:00
Tom Gundersen 243d182543 udev: event - move renaming of udev_device to libudev
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.
2015-01-26 13:33:00 +01:00
Tom Gundersen c532d8a00c udev: builtin-hwdb - port to sd-hwdb 2014-12-15 20:40:09 +01:00
Kay Sievers 41b848b0ea udev: move global property handling from libudev to udevd 2014-11-13 13:50:01 +01:00
Kay Sievers 25e773eeb4 udev: switch to systemd logging functions 2014-11-13 13:12:57 +01:00
Kay Sievers a974cacd9a libudev: we do not log errors from libraries 2014-11-13 11:42:24 +01:00
Kay Sievers b12b78712e udev: use the systemd logging functions in udev tools 2014-11-12 18:35:18 +01:00
Robert Milasan 572016d1c2 udev: fix path for database names on 'change' event
If a device does not have a major/minor number attached, we use different
database names than if it does. On "change" events, we didn't copy the
devnum over, therefore, we used different paths than on 'add' or 'remove'
events (where devnum was properly copied).

Fix this by always copying the devnum into the udev-device.

(David: added commit-log from email)
2014-09-18 15:28:07 +02:00
Tom Gundersen 37d522746b libudev: util - drop util_delete_path()
Use rmdir_parents() from src/shared instead.
2014-09-16 12:12:56 +02:00
Tom Gundersen 23bf8dd7d5 libudev: drop util_lookup_{user,group}
Use shared versions instead. Difference is with overwriting of repeated user/group
name, and lack of logging.
2014-09-16 12:12:56 +02:00
David Herrmann 8e3ba3772c udev: allow removing tags via TAG-="foobar"
This extends the udev parser to support OP_REMOVE (-=) and adds support
for TAG-= to remove previously set tags. We don't fail if the tag didn't
exist.

This is pretty handy if we ship default rules for seat-assignments and
users want to exclude specific devices from that. They can easily add
rules that drop any automatically added "seat" tags again.
2014-09-11 15:22:16 +02:00
Tom Gundersen 9d19a679f2 udev - drop print_kmsg
The only remaining user was 'starting version XXX', which is now logged using log_info().
2014-09-09 22:48:57 +02:00
Lennart Poettering 5168f84a29 udev: never bypass our own logging framework and call vsyslog() directly from udev tools 2014-08-11 20:13:38 +02:00
Tom Gundersen ac9c87dbc4 Revert "libudev: use get_*_creds from shared rather than util_lookup_*"
This reverts commit a56ba6158b.

The commit was pushed in error.
2014-08-01 22:33:20 +02:00
Tom Gundersen a56ba6158b libudev: use get_*_creds from shared rather than util_lookup_* 2014-08-01 16:34:50 +02:00
Kay Sievers b26618399e udev: declare some symbols static 2013-11-13 03:34:24 +01:00
Kay Sievers e3dc56a219 udev: declare some symbols static 2013-11-12 18:09:08 +01:00
Lennart Poettering 44b601bc79 macro: clean up usage of gcc attributes
Always use our own macros, and name all our own macros the same style.
2013-10-16 06:14:59 +02:00
Kay Sievers d5a89d7dc1 udev: move string copy functions to shared/ 2013-01-09 19:06:46 +01:00
Kay Sievers 1328f66ad1 udev: net_id - append "dev_id" value if needed 2013-01-04 19:08:08 +01:00