| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
| |
parse-util.c
And port config_parse_exec_oom_score_adjust() over to use it.
While we are at it, let's also fix config_parse_exec_oom_score_adjust()
to accept an empty string for turning off OOM score adjustments set
earlier.
|
|
|
|
|
|
|
|
|
| |
We use MTUs all over the place, let's add a unified, strict parser for
it, that takes MTU ranges into account.
We already have parse_ifindex() close-by, hence this appears to be a
natural addition, in particular as the range checking is not entirely
trivial to do, as it depends on the protocol used.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
What's good for uint16_t is also good for unsigned.
This is preparation for: #8140
|
|
|
|
|
|
|
| |
safe_atou16_full() is like safe_atou16() but also takes a base
parameter. safe_atou16() is then implemented as inline function on top
of it, passing 0 as base. Similar safe_atoux16() is reworked as inline
function too, with 16 as base.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.
This takes inspiration from Rust:
https://doc.rust-lang.org/std/option/enum.Option.html#method.take
and was suggested by Alan Jenkins (@sourcejedi).
It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)
|
|
|
|
| |
src/basic (1/6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds safe_atoux16 for parsing an unsigned hexadecimal 16bit int, and
uses that for parsing USB device and vendor IDs.
This fixes a compile error with gcc-8 because while we know that USB IDs are 2 bytes,
the compiler does not know that.
../src/udev/udev-builtin-hwdb.c:80:38: error: '%04X' directive output may be
truncated writing between 4 and 8 bytes into a region of size between 2 and 6
[-Werror=format-truncation=]
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
|
|
|
|
|
| |
We shouldn't accept percentages beyon INT32_MAX and consider them
valid.
|
|
|
|
| |
Let's not rely on C's downgrade-to-bool feature to check for NUL bytes
|
| |
|
|
|
|
| |
They are used in later commits.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
linux/sockios.h is needed for the SIOCGSTAMPNS macro
xlocale.h is included indirectly in glibc and doesn't even exist in
other libcs
|
|
|
|
|
| |
These functions, although not used by elogind itself, are mostly tiny
and crucial for important tests to work.
|
| |
|
|
|
|
|
|
| |
1. Listed in TODO.
2. Tree wide replace safe_atou16 with parse_ip_port incase
it's used for ports.
|
| |
|
| |
|
|
|
|
| |
This permits CPUQuota to accept greater values as documented.
|
| |
|
|
|
|
| |
And port a couple of users over to it.
|
| |
|
| |
|
|
|
|
|
|
| |
- musl-libc has no <bits/local_lim.h>
- musl-libc has no <xlocale.h>
- added <missing.h> include to basic/mdkir.c
|
| |
|
|
|
|
|
| |
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive.
|
| |
|
| |
|
|
The util.[hc] files have been stripped of a lot of functions, that
got sorted into various new files representing the type of
utility.
This commit adds the missing files.
|