diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index ec270e5e96..bc2d1615f9 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -2629,10 +2629,10 @@ Token=prefixstable:2002:da8:1::
BootServerAddress=
- Takes an IPv4 address of the boot server used by e.g. PXE boot systems. When specified,
- the address is set to the siaddr field of the DHCP message header. See
- RFC 2131 for more details.
- Defaults to unset.
+ Takes an IPv4 address of the boot server used by e.g. PXE boot systems. When specified, this
+ address is sent in the field of the DHCP message header. See RFC 2131 for more details. Defaults to
+ unset.
@@ -2640,13 +2640,13 @@ Token=prefixstable:2002:da8:1::
BootServerName=
- Takes a name of the boot server used by e.g. PXE boot systems. When specified, the
- server name is set to the DHCP option 66. See
- RFC 2132 for more details.
- Defaults to unset.
- Note that typically one of
- BootServerName=/BootServerAddress= is sufficient to be
- set, but both can be set too, if desired.
+ Takes a name of the boot server used by e.g. PXE boot systems. When specified, this name is
+ sent in the DHCP option 66 ("TFTP server name"). See RFC 2132 for more details. Defaults to
+ unset.
+
+ Note that typically setting one of BootServerName= or
+ BootServerAddress= is sufficient, but both can be set too, if desired.
@@ -2654,10 +2654,10 @@ Token=prefixstable:2002:da8:1::
BootFilename=
- Takes a path or URL to a file loaded by e.g. a PXE boot loader. The specified path is
- set to the DHCP option 67. See
- RFC 2132 for more details.
- Defaults to unset.
+ Takes a path or URL to a file loaded by e.g. a PXE boot loader. When specified, this path is
+ sent in the DHCP option 67 ("Bootfile name"). See RFC 2132 for more details. Defaults to
+ unset.
diff --git a/src/basic/errno-to-name.awk b/src/basic/errno-to-name.awk
index 6b18a90e13..8442124488 100644
--- a/src/basic/errno-to-name.awk
+++ b/src/basic/errno-to-name.awk
@@ -3,7 +3,7 @@
BEGIN{
print "static const char* const errno_names[] = { "
}
-!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
+!/(EDEADLOCK|EWOULDBLOCK|ENOTSUP)/ {
printf " [%s] = \"%s\",\n", $1, $1
}
END{
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index 8b3341c643..488cb30fe3 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -1163,12 +1163,12 @@ static int lock_image_fd(int image_fd, const char *ip) {
if (flock(image_fd, LOCK_EX|LOCK_NB) < 0) {
- if (errno == EWOULDBLOCK)
+ if (errno == EAGAIN)
log_error_errno(errno, "Image file '%s' already locked, can't use.", ip);
else
log_error_errno(errno, "Failed to lock image file '%s': %m", ip);
- return errno != EWOULDBLOCK ? -errno : -EADDRINUSE; /* Make error recognizable */
+ return errno != EAGAIN ? -errno : -EADDRINUSE; /* Make error recognizable */
}
log_info("Successfully locked image file '%s'.", ip);
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 519cd198e5..e06a05db4b 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -217,28 +217,26 @@ static int get_child_nodes(
const char *prefix,
struct node *n,
unsigned flags,
- OrderedSet **_s,
+ OrderedSet **ret,
sd_bus_error *error) {
- OrderedSet *s = NULL;
+ _cleanup_ordered_set_free_free_ OrderedSet *s = NULL;
int r;
assert(bus);
assert(prefix);
assert(n);
- assert(_s);
+ assert(ret);
s = ordered_set_new(&string_hash_ops);
if (!s)
return -ENOMEM;
r = add_subtree_to_set(bus, prefix, n, flags, s, error);
- if (r < 0) {
- ordered_set_free_free(s);
+ if (r < 0)
return r;
- }
- *_s = s;
+ *ret = TAKE_PTR(s);
return 0;
}
@@ -1473,7 +1471,7 @@ int bus_process_object(sd_bus *bus, sd_bus_message *m) {
return 1;
}
-static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
+static struct node* bus_node_allocate(sd_bus *bus, const char *path) {
struct node *n, *parent;
const char *e;
_cleanup_free_ char *s = NULL;
@@ -1499,8 +1497,7 @@ static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
if (streq(path, "/"))
parent = NULL;
else {
- e = strrchr(path, '/');
- assert(e);
+ assert_se(e = strrchr(path, '/'));
p = strndupa_safe(path, MAX(1, e - path));
diff --git a/tools/dbus_exporter.py b/tools/dbus_exporter.py
index 4da8b82af4..f94f261e07 100755
--- a/tools/dbus_exporter.py
+++ b/tools/dbus_exporter.py
@@ -4,58 +4,39 @@ from argparse import ArgumentParser
from pathlib import Path
from subprocess import run, PIPE
-
def extract_interfaces_xml(output_dir, executable):
- list_interfaces_process = run(
+ proc = run(
args=[executable.absolute(), '--bus-introspect', 'list'],
stdout=PIPE,
check=True,
- universal_newlines=True,
- )
+ universal_newlines=True)
- interfaces_lines = list_interfaces_process.stdout.splitlines()
-
- interface_names = [x.split()[1] for x in interfaces_lines]
+ interface_names = (x.split()[1] for x in proc.stdout.splitlines())
for interface_name in interface_names:
- interface_introspection_run = run(
+ proc = run(
args=[executable.absolute(), '--bus-introspect', interface_name],
stdout=PIPE,
check=True,
- universal_newlines=True,
- )
+ universal_newlines=True)
interface_file_name = output_dir / (interface_name + '.xml')
- with open(interface_file_name, mode='w') as f:
- f.write(interface_introspection_run.stdout)
+ interface_file_name.write_text(proc.stdout)
interface_file_name.chmod(0o644)
-
-def iterate_executables(output_dir, executables):
- output_dir.mkdir(mode=0o755, exist_ok=True)
-
- for exe in executables:
- extract_interfaces_xml(output_dir, exe)
-
-
def main():
parser = ArgumentParser()
-
- parser.add_argument(
- 'output',
- type=Path,
- )
-
- parser.add_argument(
- 'executables',
- type=Path,
- nargs='+',
- )
+ parser.add_argument('output',
+ type=Path)
+ parser.add_argument('executables',
+ nargs='+',
+ type=Path)
args = parser.parse_args()
- iterate_executables(args.output, args.executables)
-
+ args.output.mkdir(exist_ok=True)
+ for exe in args.executables:
+ extract_interfaces_xml(args.output, exe)
if __name__ == '__main__':
main()