From 5963cdf49867885d1d0641fe0693a3513aa4182a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 2 Nov 2025 17:43:14 +0900 Subject: [PATCH 1/3] tree-wide: add missing '#pragma once' --- src/analyze/analyze-compare-versions.h | 1 + src/analyze/analyze-fdstore.h | 1 + src/analyze/analyze-image-policy.h | 1 + src/boot/export-vars.h | 1 + src/bootctl/bootctl-reboot-to-firmware.h | 1 + src/bootctl/bootctl-status.h | 1 + src/bootctl/bootctl-uki.h | 1 + src/core/bpf/restrict-fs/restrict-fs-skel.h | 1 + src/core/bpf/restrict-ifaces/restrict-ifaces-skel.h | 1 + src/core/bpf/socket-bind/socket-bind-api.bpf.h | 1 + src/core/bpf/socket-bind/socket-bind-skel.h | 1 + src/fundamental/confidential-virt-fundamental.h | 1 + src/fundamental/sbat.h | 1 + src/libsystemd/sd-bus/test-vtable-data.h | 1 + src/network/bpf/sysctl-monitor/sysctl-monitor-skel.h | 1 + src/network/networkctl-link-info.h | 1 + src/nspawn/nspawn-bind-user.h | 1 + src/nsresourced/bpf/userns-restrict/userns-restrict-skel.h | 1 + src/shared/kernel-config.h | 1 + src/sysupdate/sysupdate-feature.h | 1 + src/vmspawn/vmspawn-register.h | 1 + 21 files changed, 21 insertions(+) diff --git a/src/analyze/analyze-compare-versions.h b/src/analyze/analyze-compare-versions.h index ac90ede2f0..9191303903 100644 --- a/src/analyze/analyze-compare-versions.h +++ b/src/analyze/analyze-compare-versions.h @@ -1,3 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once int verb_compare_versions(int argc, char *argv[], void *userdata); diff --git a/src/analyze/analyze-fdstore.h b/src/analyze/analyze-fdstore.h index e82d034245..d548ad2b4d 100644 --- a/src/analyze/analyze-fdstore.h +++ b/src/analyze/analyze-fdstore.h @@ -1,3 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once int verb_fdstore(int argc, char *argv[], void *userdata); diff --git a/src/analyze/analyze-image-policy.h b/src/analyze/analyze-image-policy.h index fa08447822..16c1e966e8 100644 --- a/src/analyze/analyze-image-policy.h +++ b/src/analyze/analyze-image-policy.h @@ -1,3 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once int verb_image_policy(int argc, char *argv[], void *userdata); diff --git a/src/boot/export-vars.h b/src/boot/export-vars.h index a925d09827..23a42cf773 100644 --- a/src/boot/export-vars.h +++ b/src/boot/export-vars.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "proto/loaded-image.h" diff --git a/src/bootctl/bootctl-reboot-to-firmware.h b/src/bootctl/bootctl-reboot-to-firmware.h index 5ac2e9c40b..c8b5500448 100644 --- a/src/bootctl/bootctl-reboot-to-firmware.h +++ b/src/bootctl/bootctl-reboot-to-firmware.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" diff --git a/src/bootctl/bootctl-status.h b/src/bootctl/bootctl-status.h index 234a44546e..36609fb075 100644 --- a/src/bootctl/bootctl-status.h +++ b/src/bootctl/bootctl-status.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" diff --git a/src/bootctl/bootctl-uki.h b/src/bootctl/bootctl-uki.h index dbbd41f45c..99c8ff5c8b 100644 --- a/src/bootctl/bootctl-uki.h +++ b/src/bootctl/bootctl-uki.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" diff --git a/src/core/bpf/restrict-fs/restrict-fs-skel.h b/src/core/bpf/restrict-fs/restrict-fs-skel.h index 51b15ae812..796c85cf54 100644 --- a/src/core/bpf/restrict-fs/restrict-fs-skel.h +++ b/src/core/bpf/restrict-fs/restrict-fs-skel.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/core/bpf/restrict-ifaces/restrict-ifaces-skel.h b/src/core/bpf/restrict-ifaces/restrict-ifaces-skel.h index fbebad688d..7172929e41 100644 --- a/src/core/bpf/restrict-ifaces/restrict-ifaces-skel.h +++ b/src/core/bpf/restrict-ifaces/restrict-ifaces-skel.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/core/bpf/socket-bind/socket-bind-api.bpf.h b/src/core/bpf/socket-bind/socket-bind-api.bpf.h index 4fe08f1f44..9bd7c0f7ff 100644 --- a/src/core/bpf/socket-bind/socket-bind-api.bpf.h +++ b/src/core/bpf/socket-bind/socket-bind-api.bpf.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/core/bpf/socket-bind/socket-bind-skel.h b/src/core/bpf/socket-bind/socket-bind-skel.h index 72d708dbfc..b1dfa246ca 100644 --- a/src/core/bpf/socket-bind/socket-bind-skel.h +++ b/src/core/bpf/socket-bind/socket-bind-skel.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/fundamental/confidential-virt-fundamental.h b/src/fundamental/confidential-virt-fundamental.h index 618b5800ea..d78ad3650c 100644 --- a/src/fundamental/confidential-virt-fundamental.h +++ b/src/fundamental/confidential-virt-fundamental.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include diff --git a/src/fundamental/sbat.h b/src/fundamental/sbat.h index 1a6e678b35..060a34c947 100644 --- a/src/fundamental/sbat.h +++ b/src/fundamental/sbat.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #ifdef SBAT_DISTRO # include "version.h" diff --git a/src/libsystemd/sd-bus/test-vtable-data.h b/src/libsystemd/sd-bus/test-vtable-data.h index 57fd5eaf1f..81c7f52b1c 100644 --- a/src/libsystemd/sd-bus/test-vtable-data.h +++ b/src/libsystemd/sd-bus/test-vtable-data.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include diff --git a/src/network/bpf/sysctl-monitor/sysctl-monitor-skel.h b/src/network/bpf/sysctl-monitor/sysctl-monitor-skel.h index 26ee294578..7d664896c9 100644 --- a/src/network/bpf/sysctl-monitor/sysctl-monitor-skel.h +++ b/src/network/bpf/sysctl-monitor/sysctl-monitor-skel.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/network/networkctl-link-info.h b/src/network/networkctl-link-info.h index cb0f3a9b16..268798dc7f 100644 --- a/src/network/networkctl-link-info.h +++ b/src/network/networkctl-link-info.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include #include diff --git a/src/nspawn/nspawn-bind-user.h b/src/nspawn/nspawn-bind-user.h index 672c23b251..0c182dd8d4 100644 --- a/src/nspawn/nspawn-bind-user.h +++ b/src/nspawn/nspawn-bind-user.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" diff --git a/src/nsresourced/bpf/userns-restrict/userns-restrict-skel.h b/src/nsresourced/bpf/userns-restrict/userns-restrict-skel.h index a7cbeb8e75..ef158e962b 100644 --- a/src/nsresourced/bpf/userns-restrict/userns-restrict-skel.h +++ b/src/nsresourced/bpf/userns-restrict/userns-restrict-skel.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once /* The SPDX header above is actually correct in claiming this was * LGPL-2.1-or-later, because it is. Since the kernel doesn't consider that diff --git a/src/shared/kernel-config.h b/src/shared/kernel-config.h index faa05d34a6..5d0f00c929 100644 --- a/src/shared/kernel-config.h +++ b/src/shared/kernel-config.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" diff --git a/src/sysupdate/sysupdate-feature.h b/src/sysupdate/sysupdate-feature.h index 08ba9f0675..fcd05c9708 100644 --- a/src/sysupdate/sysupdate-feature.h +++ b/src/sysupdate/sysupdate-feature.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "sysupdate-forward.h" diff --git a/src/vmspawn/vmspawn-register.h b/src/vmspawn/vmspawn-register.h index c55adcf48d..eeee16f701 100644 --- a/src/vmspawn/vmspawn-register.h +++ b/src/vmspawn/vmspawn-register.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once #include "shared-forward.h" From 89040373dd989d22ca62e4aff9b9328c1d1a8d68 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 5 Nov 2025 02:42:19 +0900 Subject: [PATCH 2/3] libsystemd: drop unused header Follow-up for 2dbf1c0f1556bcf8fbab2491ec0f23a85884c551. --- src/systemd/sd-utf8.h | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/systemd/sd-utf8.h diff --git a/src/systemd/sd-utf8.h b/src/systemd/sd-utf8.h deleted file mode 100644 index 556b21506f..0000000000 --- a/src/systemd/sd-utf8.h +++ /dev/null @@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifndef foosdutf8hfoo -#define foosdutf8hfoo - -/*** - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "_sd-common.h" - -_SD_BEGIN_DECLARATIONS; - -_sd_pure_ const char *sd_utf8_is_valid(const char *s); -_sd_pure_ const char *sd_ascii_is_valid(const char *s); - -_SD_END_DECLARATIONS; - -#endif From bb1c5449fb082d263d824e19aa14648ca1a54972 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 2 Nov 2025 17:45:43 +0900 Subject: [PATCH 3/3] sd-dns-resolver: move header to src/systemd This also adds missing license header. Follow-up for ee2108dcd5f62593a3081b57cc92b3535d8096fa. --- src/libsystemd-network/ndisc-option.h | 1 + src/systemd/meson.build | 1 + .../sd-dns-resolver.h | 29 +++++++++++++++---- 3 files changed, 25 insertions(+), 6 deletions(-) rename src/{libsystemd-network => systemd}/sd-dns-resolver.h (68%) diff --git a/src/libsystemd-network/ndisc-option.h b/src/libsystemd-network/ndisc-option.h index 8517f68dfb..8a24574d4a 100644 --- a/src/libsystemd-network/ndisc-option.h +++ b/src/libsystemd-network/ndisc-option.h @@ -5,6 +5,7 @@ #include #include "sd-dns-resolver.h" +#include "sd-forward.h" #include "time-util.h" diff --git a/src/systemd/meson.build b/src/systemd/meson.build index 613806c2f9..c3d2c1befb 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -35,6 +35,7 @@ _not_installed_headers = [ 'sd-dhcp6-lease.h', 'sd-dhcp6-option.h', 'sd-dhcp6-protocol.h', + 'sd-dns-resolver.h', 'sd-ipv4acd.h', 'sd-ipv4ll.h', 'sd-lldp-rx.h', diff --git a/src/libsystemd-network/sd-dns-resolver.h b/src/systemd/sd-dns-resolver.h similarity index 68% rename from src/libsystemd-network/sd-dns-resolver.h rename to src/systemd/sd-dns-resolver.h index 02f39bc90b..a1537e8a30 100644 --- a/src/libsystemd-network/sd-dns-resolver.h +++ b/src/systemd/sd-dns-resolver.h @@ -1,16 +1,33 @@ -#ifndef SD_DNS_RESOLVER_H -#define SD_DNS_RESOLVER_H +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +#ifndef foosddnsresolverhfoo +#define foosddnsresolverhfoo + +/*** + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ #include "_sd-common.h" -#include "sd-forward.h" - _SD_BEGIN_DECLARATIONS; +struct in_addr; +struct in6_addr; + typedef struct sd_dns_resolver sd_dns_resolver; /* https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids */ -typedef enum sd_dns_alpn_flags { +__extension__ typedef enum sd_dns_alpn_flags { /* There isn't really an alpn reserved for Do53 service, but designated resolvers may or may not offer * Do53 service, so we should probably have a flag to represent this capability. Unfortunately DNR * does not indicate the status to us. */ @@ -38,4 +55,4 @@ _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dns_resolver, sd_dns_resolver_unref); _SD_END_DECLARATIONS; -#endif /* SD_DNS_RESOLVER_H */ +#endif