Commit graph

44 commits

Author SHA1 Message Date
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
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
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
Dan Streetman be45268352 udev-event: use in-place whitespace replacement
Instead of using a temp buffer to replace whitespace in variable
substitutions, just allow util_replace_whitespace to replace in-place.
Add a comment to util_replace_whitespace indicating it is used to replace
in-place, to prevent accidental future breakage.
2017-01-27 07:58:00 -05:00
Dan Streetman a9d99b32a3 libudev-util: change util_replace_whitespace to return number of chars in dest
Instead of returning 0, which is unhelpful, return the number of chars
copied into the dest string.  This allows callers that care about that
to easily use it, instead of having to calculate the strlen.

No current users of the function check the return value, so this does not
break any existing code; it is used in the following patch.
2017-01-03 17:09:46 -05:00
Thomas Hindoe Paaboel Andersen b4bbcaa9c4 tree-wide: group include of libudev.h with sd-* 2015-11-17 07:06:08 +01:00
Thomas Hindoe Paaboel Andersen cf0fbc49e6 tree-wide: sort includes
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering 7ccbd1ae84 util-lib: split out syslog-related calls into syslog-util.[ch] 2015-10-27 13:25:57 +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
Thomas Hindoe Paaboel Andersen 4835f5639a libudev-util: check length before accesing the array 2015-04-05 08:46:01 +02:00
Thomas Hindoe Paaboel Andersen 2eec67acbb remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
2015-02-23 23:53:42 +01:00
Michal Schmidt ff49bc3212 treewide: drop unnecessary trailing \n in log_*() calls 2014-11-28 14:26:31 +01:00
Kay Sievers 25e773eeb4 udev: switch to systemd logging functions 2014-11-13 13:12:57 +01:00
Zbigniew Jędrzejewski-Szmek ee7122c0ec libudev: do not accept invalid log levels
Invalid log levels lead to a assert failure later on.

https://bugs.freedesktop.org/show_bug.cgi?id=85657
2014-11-01 14:39:47 -04:00
Tom Gundersen ba7408a6e9 udev: util - use log_level_from_string() 2014-09-16 12:12:56 +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
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
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
Lennart Poettering 955d98c9c1 everywhere: make use of new0() and macro() macros, and stop using perror() 2014-02-13 14:45:51 +01:00
Kay Sievers 57d0e6b273 libudev: ship the original MurmurHash2.[ch] file 2013-12-23 02:55:06 +01:00
Dave Reisner 8f6ce71fe7 device-nodes: move device node specific code to own file
In the process, rename udev_encode_string which is poorly named for what
it does. It deals specifically with encoding names that udev creates and
has its own rules: utf8 is valid but some ascii is not (e.g. path
separators), and everything else is simply escaped. Rename it to
encode_devnode_name.
2013-09-19 11:50:34 -04:00
Dave Reisner 02a36bc9a1 move utf8 functions from libudev-private.h to utf8.h
There's now some more obvious overlap amongst the two utf8 validation
functions, but no more than there already was previously.

This also adds some menial tests for anyone who wants to do more
merging of these two in the future.
2013-09-17 16:31:32 -04:00
Zbigniew Jędrzejewski-Szmek 4dd1de72e8 Remove some dead code
Based on coverity report.
2013-03-31 14:28:36 -04:00
Jan Engelhardt acd42fae59 libudev: avoid potential misaligned accesses
clang reports:
  src/libudev/libudev-util.c:665:35: warning: cast from
  "const unsigned char *" to "unsigned int *" increases required alignment
  from 1 to 4 [-Wcast-align]
2013-03-20 16:18:04 +01:00
Thomas Hindoe Paaboel Andersen 090be86534 use streq instead of strcmp 2013-02-13 18:14:20 +01: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
Kay Sievers 88a6477ef3 libudev: update copyright headers 2012-11-12 17:50:33 +01:00
Kay Sievers 40fe8b11be udev: use usec_t and now() 2012-11-12 01:03:14 +01:00
Kay Sievers cd8651982b libudev: remove dead code 2012-09-19 19:36:35 +02:00
Kay Sievers c6eefe3664 udev: avoid creating /dev/kmsg with fopen() to support CONFIG_PRINTK=n 2012-07-14 00:33:59 +02:00
Kay Sievers c8f8394a93 libudev: prefix log macros with 'udev_' 2012-04-26 17:43:48 +02:00
Kay Sievers 21dbe43aec docs: hook-up gtk-doc to 'make check' 2012-04-20 03:25:36 +02:00
Kay Sievers 9e13dbae50 udev: replace util_create_path() with mkdir_parents() 2012-04-17 01:09:39 +02:00
Kay Sievers 33502ffe2e udev: use startswith() and streq() 2012-04-16 20:54:17 +02:00
Kay Sievers bb061708d5 udev: move libudev, gudev to src/; move gudev/docs/, udev/docs/ to to docs/ 2012-04-13 19:22:06 +02:00
Renamed from src/udev/libudev-util.c (Browse further)