[systemd-devel] [PATCH] use #pragma once instead of foo*foo #define guards
Shawn Landden
shawnlandden at gmail.com
Wed Jul 18 10:07:51 PDT 2012
#pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported
in other compilers.
I've been using and maintaining (rebasing) this patch for a while now, as
it annoyed me to see #ifndef fooblahfoo, etc all over the place,
almost arrogant about the annoyance of having to define all these names to
perform a commen but neccicary functionality, when a completely superior
alternative exists.
I havn't sent it till now, cause its kindof a style change, and it is bad
voodoo to mess with style that has been established by more established
editors. So feel free to lambast me as a crazy bafoon.
v2 - preserve externally used headers
---
src/core/automount.h | 5 +----
src/core/build.h | 5 +----
src/core/bus-errors.h | 5 +----
src/core/cgroup-attr.h | 5 +----
src/core/cgroup.h | 5 +----
src/core/condition.h | 5 +----
src/core/dbus-automount.h | 5 +----
src/core/dbus-device.h | 5 +----
src/core/dbus-execute.h | 5 +----
src/core/dbus-job.h | 5 +----
src/core/dbus-manager.h | 5 +----
src/core/dbus-mount.h | 5 +----
src/core/dbus-path.h | 5 +----
src/core/dbus-service.h | 5 +----
src/core/dbus-snapshot.h | 5 +----
src/core/dbus-socket.h | 5 +----
src/core/dbus-swap.h | 5 +----
src/core/dbus-target.h | 5 +----
src/core/dbus-timer.h | 5 +----
src/core/dbus-unit.h | 5 +----
src/core/dbus.h | 5 +----
src/core/device.h | 5 +----
src/core/execute.h | 5 +----
src/core/fdset.h | 5 +----
src/core/hostname-setup.h | 5 +----
src/core/ima-setup.h | 5 +----
src/core/job.h | 5 +----
src/core/kmod-setup.h | 5 +----
src/core/load-dropin.h | 5 +----
src/core/load-fragment.h | 5 +----
src/core/locale-setup.h | 5 +----
src/core/loopback-setup.h | 5 +----
src/core/machine-id-setup.h | 5 +----
src/core/manager.h | 5 +----
src/core/mount-setup.h | 5 +----
src/core/mount.h | 5 +----
src/core/namespace.h | 5 +----
src/core/path.h | 5 +----
src/core/selinux-setup.h | 5 +----
src/core/service.h | 5 +----
src/core/snapshot.h | 5 +----
src/core/socket.h | 5 +----
src/core/special.h | 5 +----
src/core/swap.h | 5 +----
src/core/sysfs-show.h | 5 +----
src/core/target.h | 5 +----
src/core/tcpwrap.h | 5 +----
src/core/timer.h | 5 +----
src/core/umount.h | 5 +----
src/core/unit.h | 5 +----
src/journal/compress.h | 5 +----
src/journal/journal-def.h | 5 +----
src/journal/journal-file.h | 5 +----
src/journal/journal-internal.h | 4 +---
src/journal/journal-rate-limit.h | 5 +----
src/journal/journald.h | 5 +----
src/journal/lookup3.h | 5 +----
src/login/logind-acl.h | 5 +----
src/login/logind-device.h | 5 +----
src/login/logind-seat.h | 5 +----
src/login/logind-session.h | 5 +----
src/login/logind-user.h | 5 +----
src/login/logind.h | 5 +----
src/readahead/readahead-common.h | 5 +----
src/shared/acl-util.h | 5 +----
src/shared/ask-password-api.h | 5 +----
src/shared/cgroup-util.h | 5 +----
src/shared/conf-parser.h | 5 +----
src/shared/dbus-common.h | 5 +----
src/shared/dbus-loop.h | 5 +----
src/shared/def.h | 5 +----
src/shared/exit-status.h | 5 +----
src/shared/hashmap.h | 5 +----
src/shared/install.h | 5 +----
src/shared/label.h | 5 +----
src/shared/list.h | 5 +----
src/shared/log.h | 5 +----
src/shared/logs-show.h | 5 +----
src/shared/macro.h | 5 +----
src/shared/missing.h | 5 +----
src/shared/pager.h | 5 +----
src/shared/path-lookup.h | 5 +----
src/shared/polkit.h | 5 +----
src/shared/ratelimit.h | 5 +----
src/shared/set.h | 5 +----
src/shared/socket-util.h | 5 +----
src/shared/spawn-ask-password-agent.h | 5 +----
src/shared/specifier.h | 5 +----
src/shared/strv.h | 5 +----
src/shared/unit-name.h | 5 +----
src/shared/utf8.h | 5 +----
src/shared/util.h | 5 +----
src/shared/utmp-wtmp.h | 5 +----
src/shared/virt.h | 5 +----
src/shared/watchdog.h | 5 +----
95 files changed, 95 insertions(+), 379 deletions(-)
diff --git a/src/core/automount.h b/src/core/automount.h
index 5704502..3d5736d 100644
--- a/src/core/automount.h
+++ b/src/core/automount.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooautomounthfoo
-#define fooautomounthfoo
+#pragma once
/***
This file is part of systemd.
@@ -72,5 +71,3 @@ AutomountState automount_state_from_string(const char *s);
const char* automount_result_to_string(AutomountResult i);
AutomountResult automount_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/build.h b/src/core/build.h
index 4ccfab1..0b38050 100644
--- a/src/core/build.h
+++ b/src/core/build.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foobuildhfoo
-#define foobuildhfoo
+#pragma once
/***
This file is part of systemd.
@@ -65,5 +64,3 @@
#endif
#define SYSTEMD_FEATURES _PAM_FEATURE_ " " _LIBWRAP_FEATURE_ " " _AUDIT_FEATURE_ " " _SELINUX_FEATURE_ " " _IMA_FEATURE_ " " _SYSVINIT_FEATURE_ " " _LIBCRYPTSETUP_FEATURE_
-
-#endif
diff --git a/src/core/bus-errors.h b/src/core/bus-errors.h
index a6f055f..04c1b28 100644
--- a/src/core/bus-errors.h
+++ b/src/core/bus-errors.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foobuserrorshfoo
-#define foobuserrorshfoo
+#pragma once
/***
This file is part of systemd.
@@ -54,5 +53,3 @@ static inline const char *bus_error(const DBusError *e, int r) {
return strerror(-r);
}
-
-#endif
diff --git a/src/core/cgroup-attr.h b/src/core/cgroup-attr.h
index 2b3c1ae..2b754ea 100644
--- a/src/core/cgroup-attr.h
+++ b/src/core/cgroup-attr.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foocgroupattrhfoo
-#define foocgroupattrhfoo
+#pragma once
/***
This file is part of systemd.
@@ -45,5 +44,3 @@ int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b);
CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const char *controller, const char *name);
void cgroup_attribute_free_list(CGroupAttribute *first);
-
-#endif
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 65fbe4d..229da52 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foocgrouphfoo
-#define foocgrouphfoo
+#pragma once
/***
This file is part of systemd.
@@ -90,5 +89,3 @@ int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding);
int cgroup_notify_empty(Manager *m, const char *group);
Unit* cgroup_unit_by_pid(Manager *m, pid_t pid);
-
-#endif
diff --git a/src/core/condition.h b/src/core/condition.h
index 2d1f2cd..3dca432 100644
--- a/src/core/condition.h
+++ b/src/core/condition.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooconditionhfoo
-#define fooconditionhfoo
+#pragma once
/***
This file is part of systemd.
@@ -66,5 +65,3 @@ void condition_dump_list(Condition *c, FILE *f, const char *prefix);
const char* condition_type_to_string(ConditionType t);
int condition_type_from_string(const char *s);
-
-#endif
diff --git a/src/core/dbus-automount.h b/src/core/dbus-automount.h
index 6849244..b338e25 100644
--- a/src/core/dbus-automount.h
+++ b/src/core/dbus-automount.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusautomounthfoo
-#define foodbusautomounthfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBus
extern const char bus_automount_interface[];
extern const char bus_automount_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-device.h b/src/core/dbus-device.h
index 068adee..311e068 100644
--- a/src/core/dbus-device.h
+++ b/src/core/dbus-device.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusdevicehfoo
-#define foodbusdevicehfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DBusMes
extern const char bus_device_interface[];
extern const char bus_device_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-execute.h b/src/core/dbus-execute.h
index dc267e6..feb8833 100644
--- a/src/core/dbus-execute.h
+++ b/src/core/dbus-execute.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusexecutehfoo
-#define foodbusexecutehfoo
+#pragma once
/***
This file is part of systemd.
@@ -124,5 +123,3 @@ int bus_execute_append_command(DBusMessageIter *u, const char *property, void *d
int bus_execute_append_kill_mode(DBusMessageIter *i, const char *property, void *data);
int bus_execute_append_env_files(DBusMessageIter *i, const char *property, void *data);
int bus_execute_append_syscall_filter(DBusMessageIter *i, const char *property, void *data);
-
-#endif
diff --git a/src/core/dbus-job.h b/src/core/dbus-job.h
index 1ee0a42..a1b928f 100644
--- a/src/core/dbus-job.h
+++ b/src/core/dbus-job.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusjobhfoo
-#define foodbusjobhfoo
+#pragma once
/***
This file is part of systemd.
@@ -32,5 +31,3 @@ void bus_job_send_removed_signal(Job *j);
extern const DBusObjectPathVTable bus_job_vtable;
extern const char bus_job_interface[];
-
-#endif
diff --git a/src/core/dbus-manager.h b/src/core/dbus-manager.h
index 0563b32..f0dce5a 100644
--- a/src/core/dbus-manager.h
+++ b/src/core/dbus-manager.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusmanagerhfoo
-#define foodbusmanagerhfoo
+#pragma once
/***
This file is part of systemd.
@@ -27,5 +26,3 @@
extern const DBusObjectPathVTable bus_manager_vtable;
extern const char bus_manager_interface[];
-
-#endif
diff --git a/src/core/dbus-mount.h b/src/core/dbus-mount.h
index 0974213..8597394 100644
--- a/src/core/dbus-mount.h
+++ b/src/core/dbus-mount.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusmounthfoo
-#define foodbusmounthfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMess
extern const char bus_mount_interface[];
extern const char bus_mount_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-path.h b/src/core/dbus-path.h
index db2d5b9..c945f7d 100644
--- a/src/core/dbus-path.h
+++ b/src/core/dbus-path.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbuspathhfoo
-#define foodbuspathhfoo
+#pragma once
/***
This file is part of systemd.
@@ -31,5 +30,3 @@ DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBusMessa
extern const char bus_path_interface[];
extern const char bus_path_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-service.h b/src/core/dbus-service.h
index 27f65f5..143aed7 100644
--- a/src/core/dbus-service.h
+++ b/src/core/dbus-service.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusservicehfoo
-#define foodbusservicehfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, DBusMe
extern const char bus_service_interface[];
extern const char bus_service_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-snapshot.h b/src/core/dbus-snapshot.h
index fea1387..1208aaf 100644
--- a/src/core/dbus-snapshot.h
+++ b/src/core/dbus-snapshot.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbussnapshothfoo
-#define foodbussnapshothfoo
+#pragma once
/***
This file is part of systemd.
@@ -29,5 +28,3 @@
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
extern const char bus_snapshot_interface[];
-
-#endif
diff --git a/src/core/dbus-socket.h b/src/core/dbus-socket.h
index eafb3af..5369b22 100644
--- a/src/core/dbus-socket.h
+++ b/src/core/dbus-socket.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbussockethfoo
-#define foodbussockethfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
extern const char bus_socket_interface[];
extern const char bus_socket_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-swap.h b/src/core/dbus-swap.h
index 1967565..41fe444 100644
--- a/src/core/dbus-swap.h
+++ b/src/core/dbus-swap.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusswaphfoo
-#define foodbusswaphfoo
+#pragma once
/***
This file is part of systemd.
@@ -31,5 +30,3 @@ DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessa
extern const char bus_swap_interface[];
extern const char bus_swap_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-target.h b/src/core/dbus-target.h
index f11cec7..a8a0304 100644
--- a/src/core/dbus-target.h
+++ b/src/core/dbus-target.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbustargethfoo
-#define foodbustargethfoo
+#pragma once
/***
This file is part of systemd.
@@ -29,5 +28,3 @@
DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
extern const char bus_target_interface[];
-
-#endif
diff --git a/src/core/dbus-timer.h b/src/core/dbus-timer.h
index daa26c8..9ac3050 100644
--- a/src/core/dbus-timer.h
+++ b/src/core/dbus-timer.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbustimerhfoo
-#define foodbustimerhfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBusMess
extern const char bus_timer_interface[];
extern const char bus_timer_invalidating_properties[];
-
-#endif
diff --git a/src/core/dbus-unit.h b/src/core/dbus-unit.h
index d5902ee..5a3a9be 100644
--- a/src/core/dbus-unit.h
+++ b/src/core/dbus-unit.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusunithfoo
-#define foodbusunithfoo
+#pragma once
/***
This file is part of systemd.
@@ -138,5 +137,3 @@ void bus_unit_send_removed_signal(Unit *u);
extern const DBusObjectPathVTable bus_unit_vtable;
extern const char bus_unit_interface[];
-
-#endif
diff --git a/src/core/dbus.h b/src/core/dbus.h
index ed0b1c7..0502d7c 100644
--- a/src/core/dbus.h
+++ b/src/core/dbus.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbushfoo
-#define foodbushfoo
+#pragma once
/***
This file is part of systemd.
@@ -49,5 +48,3 @@ void bus_broadcast_finished(Manager *m, usec_t kernel_usec, usec_t initrd_usec,
#define BUS_PENDING_CALL_NAME(m, p) dbus_pending_call_get_data((p), (m)->name_data_slot)
extern const char * const bus_interface_table[];
-
-#endif
diff --git a/src/core/device.h b/src/core/device.h
index fa80657..3c4604f 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodevicehfoo
-#define foodevicehfoo
+#pragma once
/***
This file is part of systemd.
@@ -55,5 +54,3 @@ void device_fd_event(Manager *m, int events);
const char* device_state_to_string(DeviceState i);
DeviceState device_state_from_string(const char *s);
-
-#endif
diff --git a/src/core/execute.h b/src/core/execute.h
index 187165c..09f246e 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooexecutehfoo
-#define fooexecutehfoo
+#pragma once
/***
This file is part of systemd.
@@ -235,5 +234,3 @@ KillMode kill_mode_from_string(const char *s);
const char *kill_who_to_string(KillWho k);
KillWho kill_who_from_string(const char *s);
-
-#endif
diff --git a/src/core/fdset.h b/src/core/fdset.h
index bb58172..c3e408c 100644
--- a/src/core/fdset.h
+++ b/src/core/fdset.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foofdsethfoo
-#define foofdsethfoo
+#pragma once
/***
This file is part of systemd.
@@ -36,5 +35,3 @@ int fdset_remove(FDSet *s, int fd);
int fdset_new_fill(FDSet **_s);
int fdset_cloexec(FDSet *fds, bool b);
-
-#endif
diff --git a/src/core/hostname-setup.h b/src/core/hostname-setup.h
index 9550b8c..8dc3a9e 100644
--- a/src/core/hostname-setup.h
+++ b/src/core/hostname-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foohostnamesetuphfoo
-#define foohostnamesetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int hostname_setup(void);
-
-#endif
diff --git a/src/core/ima-setup.h b/src/core/ima-setup.h
index 8de64bf..14b56d1 100644
--- a/src/core/ima-setup.h
+++ b/src/core/ima-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooimasetuphfoo
-#define fooimasetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -25,5 +24,3 @@
***/
int ima_setup(void);
-
-#endif
diff --git a/src/core/job.h b/src/core/job.h
index 3208e6c..349fb68 100644
--- a/src/core/job.h
+++ b/src/core/job.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojobhfoo
-#define foojobhfoo
+#pragma once
/***
This file is part of systemd.
@@ -229,5 +228,3 @@ JobMode job_mode_from_string(const char *s);
const char* job_result_to_string(JobResult t);
JobResult job_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/kmod-setup.h b/src/core/kmod-setup.h
index faaaa9a..24dcddd 100644
--- a/src/core/kmod-setup.h
+++ b/src/core/kmod-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fookmodsetuphfoo
-#define fookmodsetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int kmod_setup(void);
-
-#endif
diff --git a/src/core/load-dropin.h b/src/core/load-dropin.h
index 0b613c5..1d2fafe 100644
--- a/src/core/load-dropin.h
+++ b/src/core/load-dropin.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooloaddropinhfoo
-#define fooloaddropinhfoo
+#pragma once
/***
This file is part of systemd.
@@ -27,5 +26,3 @@
/* Read service data supplementary drop-in directories */
int unit_load_dropin(Unit *u);
-
-#endif
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index 543e329..24f7384 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooloadfragmenthfoo
-#define fooloadfragmenthfoo
+#pragma once
/***
This file is part of systemd.
@@ -87,5 +86,3 @@ int config_parse_syscall_filter(const char *filename, unsigned line, const char
/* gperf prototypes */
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length);
extern const char load_fragment_gperf_nulstr[];
-
-#endif
diff --git a/src/core/locale-setup.h b/src/core/locale-setup.h
index 418fdfa..5a0f2f7 100644
--- a/src/core/locale-setup.h
+++ b/src/core/locale-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foolocalesetuphfoo
-#define foolocalesetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int locale_setup(void);
-
-#endif
diff --git a/src/core/loopback-setup.h b/src/core/loopback-setup.h
index cbb969e..dd83cf1 100644
--- a/src/core/loopback-setup.h
+++ b/src/core/loopback-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooloopbacksetuphfoo
-#define fooloopbacksetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int loopback_setup(void);
-
-#endif
diff --git a/src/core/machine-id-setup.h b/src/core/machine-id-setup.h
index 16f45d8..b9e6b4d 100644
--- a/src/core/machine-id-setup.h
+++ b/src/core/machine-id-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomachineidsetuphfoo
-#define foomachineidsetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int machine_id_setup(void);
-
-#endif
diff --git a/src/core/manager.h b/src/core/manager.h
index 6c81f92..603c2dc 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomanagerhfoo
-#define foomanagerhfoo
+#pragma once
/***
This file is part of systemd.
@@ -304,5 +303,3 @@ bool manager_get_show_status(Manager *m);
const char *manager_running_as_to_string(ManagerRunningAs i);
ManagerRunningAs manager_running_as_from_string(const char *s);
-
-#endif
diff --git a/src/core/mount-setup.h b/src/core/mount-setup.h
index 720b66f..4b521ad 100644
--- a/src/core/mount-setup.h
+++ b/src/core/mount-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomountsetuphfoo
-#define foomountsetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -32,5 +31,3 @@ int mount_cgroup_controllers(char ***join_controllers);
bool mount_point_is_api(const char *path);
bool mount_point_ignore(const char *path);
-
-#endif
diff --git a/src/core/mount.h b/src/core/mount.h
index ad9efc3..9583eeb 100644
--- a/src/core/mount.h
+++ b/src/core/mount.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomounthfoo
-#define foomounthfoo
+#pragma once
/***
This file is part of systemd.
@@ -118,5 +117,3 @@ MountExecCommand mount_exec_command_from_string(const char *s);
const char* mount_result_to_string(MountResult i);
MountResult mount_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/namespace.h b/src/core/namespace.h
index eb912e9..5d72ed9 100644
--- a/src/core/namespace.h
+++ b/src/core/namespace.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foonamespacehfoo
-#define foonamespacehfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ int setup_namespace(
char **inaccessible,
bool private_tmp,
unsigned long flags);
-
-#endif
diff --git a/src/core/path.h b/src/core/path.h
index 1b4d0d4..7792688 100644
--- a/src/core/path.h
+++ b/src/core/path.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foopathhfoo
-#define foopathhfoo
+#pragma once
/***
This file is part of systemd.
@@ -109,5 +108,3 @@ PathType path_type_from_string(const char *s);
const char* path_result_to_string(PathResult i);
PathResult path_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/selinux-setup.h b/src/core/selinux-setup.h
index e9a45f5..39e2bc2 100644
--- a/src/core/selinux-setup.h
+++ b/src/core/selinux-setup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooselinuxsetuphfoo
-#define fooselinuxsetuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -25,5 +24,3 @@
#include <stdbool.h>
int selinux_setup(bool *loaded_policy);
-
-#endif
diff --git a/src/core/service.h b/src/core/service.h
index 4a7287d..5ad09d0 100644
--- a/src/core/service.h
+++ b/src/core/service.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooservicehfoo
-#define fooservicehfoo
+#pragma once
/***
This file is part of systemd.
@@ -216,5 +215,3 @@ ServiceResult service_result_from_string(const char *s);
const char* start_limit_action_to_string(StartLimitAction i);
StartLimitAction start_limit_action_from_string(const char *s);
-
-#endif
diff --git a/src/core/snapshot.h b/src/core/snapshot.h
index 9c63216..9662d93 100644
--- a/src/core/snapshot.h
+++ b/src/core/snapshot.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foosnapshothfoo
-#define foosnapshothfoo
+#pragma once
/***
This file is part of systemd.
@@ -49,5 +48,3 @@ void snapshot_remove(Snapshot *s);
const char* snapshot_state_to_string(SnapshotState i);
SnapshotState snapshot_state_from_string(const char *s);
-
-#endif
diff --git a/src/core/socket.h b/src/core/socket.h
index 576506f..508f00e 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foosockethfoo
-#define foosockethfoo
+#pragma once
/***
This file is part of systemd.
@@ -169,5 +168,3 @@ SocketExecCommand socket_exec_command_from_string(const char *s);
const char* socket_result_to_string(SocketResult i);
SocketResult socket_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/special.h b/src/core/special.h
index f71f076..e3004a5 100644
--- a/src/core/special.h
+++ b/src/core/special.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foospecialhfoo
-#define foospecialhfoo
+#pragma once
/***
This file is part of systemd.
@@ -86,5 +85,3 @@
#define SPECIAL_RUNLEVEL3_TARGET "runlevel3.target"
#define SPECIAL_RUNLEVEL4_TARGET "runlevel4.target"
#define SPECIAL_RUNLEVEL5_TARGET "runlevel5.target"
-
-#endif
diff --git a/src/core/swap.h b/src/core/swap.h
index ff12169..d8888e1 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooswaphfoo
-#define fooswaphfoo
+#pragma once
/***
This file is part of systemd.
@@ -119,5 +118,3 @@ SwapExecCommand swap_exec_command_from_string(const char *s);
const char* swap_result_to_string(SwapResult i);
SwapResult swap_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/sysfs-show.h b/src/core/sysfs-show.h
index 51d73fb..9ffd129 100644
--- a/src/core/sysfs-show.h
+++ b/src/core/sysfs-show.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foosysfsshowhfoo
-#define foosysfsshowhfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int show_sysfs(const char *seat, const char *prefix, unsigned columns);
-
-#endif
diff --git a/src/core/target.h b/src/core/target.h
index 62bc343..1676553 100644
--- a/src/core/target.h
+++ b/src/core/target.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef footargethfoo
-#define footargethfoo
+#pragma once
/***
This file is part of systemd.
@@ -43,5 +42,3 @@ extern const UnitVTable target_vtable;
const char* target_state_to_string(TargetState i);
TargetState target_state_from_string(const char *s);
-
-#endif
diff --git a/src/core/tcpwrap.h b/src/core/tcpwrap.h
index 0c87b11..3353b65 100644
--- a/src/core/tcpwrap.h
+++ b/src/core/tcpwrap.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foolibwraphfoo
-#define foolibwraphfoo
+#pragma once
/***
This file is part of systemd.
@@ -25,5 +24,3 @@
#include <stdbool.h>
bool socket_tcpwrap(int fd, const char *name);
-
-#endif
diff --git a/src/core/timer.h b/src/core/timer.h
index 985b460..c6d1d42 100644
--- a/src/core/timer.h
+++ b/src/core/timer.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef footimerhfoo
-#define footimerhfoo
+#pragma once
/***
This file is part of systemd.
@@ -89,5 +88,3 @@ TimerBase timer_base_from_string(const char *s);
const char* timer_result_to_string(TimerResult i);
TimerResult timer_result_from_string(const char *s);
-
-#endif
diff --git a/src/core/umount.h b/src/core/umount.h
index 2e2f9c1..8439ffe 100644
--- a/src/core/umount.h
+++ b/src/core/umount.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooumounthfoo
-#define fooumounthfoo
+#pragma once
/***
This file is part of systemd.
@@ -29,5 +28,3 @@ int swapoff_all(bool *changed);
int loopback_detach_all(bool *changed);
int dm_detach_all(bool *changed);
-
-#endif
diff --git a/src/core/unit.h b/src/core/unit.h
index d0a5d64..635293f 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foounithfoo
-#define foounithfoo
+#pragma once
/***
This file is part of systemd.
@@ -544,5 +543,3 @@ UnitActiveState unit_active_state_from_string(const char *s);
const char *unit_dependency_to_string(UnitDependency i);
UnitDependency unit_dependency_from_string(const char *s);
-
-#endif
diff --git a/src/journal/compress.h b/src/journal/compress.h
index 1cdfe3d..b6f1aa0 100644
--- a/src/journal/compress.h
+++ b/src/journal/compress.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foocompresshfoo
-#define foocompresshfoo
+#pragma once
/***
This file is part of systemd.
@@ -34,5 +33,3 @@ bool uncompress_startswith(const void *src, uint64_t src_size,
void **buffer, uint64_t *buffer_size,
const void *prefix, uint64_t prefix_len,
uint8_t extra);
-
-#endif
diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h
index ac89e61..096dd8e 100644
--- a/src/journal/journal-def.h
+++ b/src/journal/journal-def.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojournaldefhfoo
-#define foojournaldefhfoo
+#pragma once
/***
This file is part of systemd.
@@ -182,5 +181,3 @@ _packed_ struct Header {
le64_t n_data;
le64_t n_fields;
};
-
-#endif
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 1f7f73a..eed49e0 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojournalfilehfoo
-#define foojournalfilehfoo
+#pragma once
/***
This file is part of systemd.
@@ -147,5 +146,3 @@ int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, usec_t *
int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to);
bool journal_file_rotate_suggested(JournalFile *f);
-
-#endif
diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h
index b767901..aa7df17 100644
--- a/src/journal/journal-internal.h
+++ b/src/journal/journal-internal.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojournalinternalhfoo
-#define foojournalinternalhfoo
+#pragma once
/***
This file is part of systemd.
@@ -110,4 +109,3 @@ struct sd_journal {
char *journal_make_match_string(sd_journal *j);
void journal_print_header(sd_journal *j);
-#endif
diff --git a/src/journal/journal-rate-limit.h b/src/journal/journal-rate-limit.h
index cbf526c..648ab22 100644
--- a/src/journal/journal-rate-limit.h
+++ b/src/journal/journal-rate-limit.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojournalratelimithfoo
-#define foojournalratelimithfoo
+#pragma once
/***
This file is part of systemd.
@@ -30,5 +29,3 @@ typedef struct JournalRateLimit JournalRateLimit;
JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst);
void journal_rate_limit_free(JournalRateLimit *r);
int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available);
-
-#endif
diff --git a/src/journal/journald.h b/src/journal/journald.h
index 3537a49..acf19b4 100644
--- a/src/journal/journald.h
+++ b/src/journal/journald.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foojournaldhfoo
-#define foojournaldhfoo
+#pragma once
/***
This file is part of systemd.
@@ -106,5 +105,3 @@ int config_parse_storage(const char *filename, unsigned line, const char *sectio
const char *storage_to_string(Storage s);
Storage storage_from_string(const char *s);
-
-#endif
diff --git a/src/journal/lookup3.h b/src/journal/lookup3.h
index 31cc2f5..502b42c 100644
--- a/src/journal/lookup3.h
+++ b/src/journal/lookup3.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foolookup3hfoo
-#define foolookup3hfoo
+#pragma once
#include <inttypes.h>
#include <sys/types.h>
@@ -21,5 +20,3 @@ static inline uint64_t hash64(const void *data, size_t length) {
return ((uint64_t) a << 32ULL) | (uint64_t) b;
}
-
-#endif
diff --git a/src/login/logind-acl.h b/src/login/logind-acl.h
index ea34590..ec09843 100644
--- a/src/login/logind-acl.h
+++ b/src/login/logind-acl.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologindaclhfoo
-#define foologindaclhfoo
+#pragma once
/***
This file is part of systemd.
@@ -56,5 +55,3 @@ static inline int devnode_acl_all(struct udev *udev,
}
#endif
-
-#endif
diff --git a/src/login/logind-device.h b/src/login/logind-device.h
index bdb9741..3b15356 100644
--- a/src/login/logind-device.h
+++ b/src/login/logind-device.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologinddevicehfoo
-#define foologinddevicehfoo
+#pragma once
/***
This file is part of systemd.
@@ -44,5 +43,3 @@ Device* device_new(Manager *m, const char *sysfs);
void device_free(Device *d);
void device_attach(Device *d, Seat *s);
void device_detach(Device *d);
-
-#endif
diff --git a/src/login/logind-seat.h b/src/login/logind-seat.h
index 1abbc34..c8ab17f 100644
--- a/src/login/logind-seat.h
+++ b/src/login/logind-seat.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologindseathfoo
-#define foologindseathfoo
+#pragma once
/***
This file is part of systemd.
@@ -82,5 +81,3 @@ extern const DBusObjectPathVTable bus_seat_vtable;
int seat_send_signal(Seat *s, bool new_seat);
int seat_send_changed(Seat *s, const char *properties);
-
-#endif
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index b255dc7..bfa4abd 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologindsessionhfoo
-#define foologindsessionhfoo
+#pragma once
/***
This file is part of systemd.
@@ -145,5 +144,3 @@ SessionClass session_class_from_string(const char *s);
const char *kill_who_to_string(KillWho k);
KillWho kill_who_from_string(const char *s);
-
-#endif
diff --git a/src/login/logind-user.h b/src/login/logind-user.h
index cffac35..a679d43 100644
--- a/src/login/logind-user.h
+++ b/src/login/logind-user.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologinduserhfoo
-#define foologinduserhfoo
+#pragma once
/***
This file is part of systemd.
@@ -83,5 +82,3 @@ int user_send_changed(User *u, const char *properties);
const char* user_state_to_string(UserState s);
UserState user_state_from_string(const char *s);
-
-#endif
diff --git a/src/login/logind.h b/src/login/logind.h
index 5e828bf..24d705b 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologindhfoo
-#define foologindhfoo
+#pragma once
/***
This file is part of systemd.
@@ -164,5 +163,3 @@ int manager_dispatch_delayed(Manager *manager);
/* gperf lookup function */
const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length);
-
-#endif
diff --git a/src/readahead/readahead-common.h b/src/readahead/readahead-common.h
index fd657a2..b34f3aa 100644
--- a/src/readahead/readahead-common.h
+++ b/src/readahead/readahead-common.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooreadaheadcommonhfoo
-#define fooreadaheadcommonhfoo
+#pragma once
/***
This file is part of systemd.
@@ -60,5 +59,3 @@ int block_set_readahead(const char *p, uint64_t bytes);
int main_collect(const char *root);
int main_replay(const char *root);
int main_analyze(const char *pack_path);
-
-#endif
diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h
index 9f11636..31fbbcd 100644
--- a/src/shared/acl-util.h
+++ b/src/shared/acl-util.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooaclutilhfoo
-#define fooaclutilhfoo
+#pragma once
/***
This file is part of systemd.
@@ -23,5 +22,3 @@
***/
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
-
-#endif
diff --git a/src/shared/ask-password-api.h b/src/shared/ask-password-api.h
index 155afad..288a0f4 100644
--- a/src/shared/ask-password-api.h
+++ b/src/shared/ask-password-api.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooaskpasswordapihfoo
-#define fooaskpasswordapihfoo
+#pragma once
/***
This file is part of systemd.
@@ -29,5 +28,3 @@ int ask_password_tty(const char *message, usec_t until, const char *flag_file, c
int ask_password_agent(const char *message, const char *icon, usec_t until, bool accept_cached, char ***_passphrases);
int ask_password_auto(const char *message, const char *icon, usec_t until, bool accept_cached, char ***_passphrases);
-
-#endif
diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h
index 7f11bc6..697669d 100644
--- a/src/shared/cgroup-util.h
+++ b/src/shared/cgroup-util.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foocgrouputilhfoo
-#define foocgrouputilhfoo
+#pragma once
/***
This file is part of systemd.
@@ -73,5 +72,3 @@ int cg_pid_get_cgroup(pid_t pid, char **root, char **cgroup);
int cg_pid_get_unit(pid_t pid, char **unit);
char **cg_shorten_controllers(char **controllers);
-
-#endif
diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h
index 2e01f9e..4f94b3b 100644
--- a/src/shared/conf-parser.h
+++ b/src/shared/conf-parser.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooconfparserhfoo
-#define fooconfparserhfoo
+#pragma once
/***
This file is part of systemd.
@@ -134,5 +133,3 @@ int config_parse_level(const char *filename, unsigned line, const char *section,
\
return 0; \
}
-
-#endif
diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h
index 9ae35df..a6703a7 100644
--- a/src/shared/dbus-common.h
+++ b/src/shared/dbus-common.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbuscommonhfoo
-#define foodbuscommonhfoo
+#pragma once
/***
This file is part of systemd.
@@ -204,5 +203,3 @@ void bus_async_unregister_and_exit(DBusConnection *bus, const char *name);
DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void *userdata);
pid_t bus_get_unix_process_id(DBusConnection *connection, const char *name, DBusError *error);
-
-#endif
diff --git a/src/shared/dbus-loop.h b/src/shared/dbus-loop.h
index 3902b35..a5e768d 100644
--- a/src/shared/dbus-loop.h
+++ b/src/shared/dbus-loop.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodbusloophfoo
-#define foodbusloophfoo
+#pragma once
/***
This file is part of systemd.
@@ -26,5 +25,3 @@
int bus_loop_open(DBusConnection *c);
int bus_loop_dispatch(int fd);
-
-#endif
diff --git a/src/shared/def.h b/src/shared/def.h
index d021e66..5ba170f 100644
--- a/src/shared/def.h
+++ b/src/shared/def.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foodefhfoo
-#define foodefhfoo
+#pragma once
/***
This file is part of systemd.
@@ -34,5 +33,3 @@
#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
#define SIGNALS_IGNORE SIGKILL,SIGPIPE
-
-#endif
diff --git a/src/shared/exit-status.h b/src/shared/exit-status.h
index 813f1ce..3f42c15 100644
--- a/src/shared/exit-status.h
+++ b/src/shared/exit-status.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooexitstatushfoo
-#define fooexitstatushfoo
+#pragma once
/***
This file is part of systemd.
@@ -82,5 +81,3 @@ const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level);
bool is_clean_exit(int code, int status);
bool is_clean_exit_lsb(int code, int status);
-
-#endif
diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h
index deefd9a..ee810f5 100644
--- a/src/shared/hashmap.h
+++ b/src/shared/hashmap.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foohashmaphfoo
-#define foohashmaphfoo
+#pragma once
/***
This file is part of systemd.
@@ -89,5 +88,3 @@ char **hashmap_get_strv(Hashmap *h);
#define HASHMAP_FOREACH_BACKWARDS(e, h, i) \
for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL))
-
-#endif
diff --git a/src/shared/install.h b/src/shared/install.h
index d365c01..f02fa3e 100644
--- a/src/shared/install.h
+++ b/src/shared/install.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooinstallhfoo
-#define fooinstallhfoo
+#pragma once
/***
This file is part of systemd.
@@ -85,5 +84,3 @@ UnitFileState unit_file_state_from_string(const char *s);
const char *unit_file_change_type_to_string(UnitFileChangeType s);
UnitFileChangeType unit_file_change_type_from_string(const char *s);
-
-#endif
diff --git a/src/shared/label.h b/src/shared/label.h
index 8d832f9..1220b18 100644
--- a/src/shared/label.h
+++ b/src/shared/label.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foolabelhfoo
-#define foolabelhfoo
+#pragma once
/***
This file is part of systemd.
@@ -46,5 +45,3 @@ int label_mkdir(const char *path, mode_t mode, bool apply);
void label_retest_selinux(void);
int label_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
-
-#endif
diff --git a/src/shared/list.h b/src/shared/list.h
index 9a491b9..47f275a 100644
--- a/src/shared/list.h
+++ b/src/shared/list.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foolisthfoo
-#define foolisthfoo
+#pragma once
/***
This file is part of systemd.
@@ -124,5 +123,3 @@
#define LIST_FOREACH_AFTER(name,i,p) \
for ((i) = (p)->name##_next; (i); (i) = (i)->name##_next)
-
-#endif
diff --git a/src/shared/log.h b/src/shared/log.h
index 59d4c00..c986b25 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologhfoo
-#define foologhfoo
+#pragma once
/***
This file is part of systemd.
@@ -108,5 +107,3 @@ int log_dump_internal(
const char *log_target_to_string(LogTarget target);
LogTarget log_target_from_string(const char *s);
-
-#endif
diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h
index 2e9cf63..4e67432 100644
--- a/src/shared/logs-show.h
+++ b/src/shared/logs-show.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foologsshowhfoo
-#define foologsshowhfoo
+#pragma once
/***
This file is part of systemd.
@@ -60,5 +59,3 @@ int show_journal_by_unit(
const char* output_mode_to_string(OutputMode m);
OutputMode output_mode_from_string(const char *s);
-
-#endif
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 97eebbc..4595750 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomacrohfoo
-#define foomacrohfoo
+#pragma once
/***
This file is part of systemd.
@@ -189,5 +188,3 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
}
#include "log.h"
-
-#endif
diff --git a/src/shared/missing.h b/src/shared/missing.h
index d918c4e..e600acc 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foomissinghfoo
-#define foomissinghfoo
+#pragma once
/***
This file is part of systemd.
@@ -191,5 +190,3 @@ static inline pid_t gettid(void) {
#ifndef PR_SET_NO_NEW_PRIVS
#define PR_SET_NO_NEW_PRIVS 38
#endif
-
-#endif
diff --git a/src/shared/pager.h b/src/shared/pager.h
index 7d2108f..dcd6195 100644
--- a/src/shared/pager.h
+++ b/src/shared/pager.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foopagerhfoo
-#define foopagerhfoo
+#pragma once
/***
This file is part of systemd.
@@ -24,5 +23,3 @@
void pager_open(void);
void pager_close(void);
-
-#endif
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index 96c49c2..0aab956 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foopathlookuphfoo
-#define foopathlookuphfoo
+#pragma once
/***
This file is part of systemd.
@@ -36,5 +35,3 @@ int user_config_home(char **config_home);
int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal, const char *generator, const char *generator_early, const char *generator_late);
void lookup_paths_free(LookupPaths *p);
-
-#endif
diff --git a/src/shared/polkit.h b/src/shared/polkit.h
index 5aecfff..6255d1f 100644
--- a/src/shared/polkit.h
+++ b/src/shared/polkit.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foopolkithfoo
-#define foopolkithfoo
+#pragma once
/***
This file is part of systemd.
@@ -32,5 +31,3 @@ int verify_polkit(
bool interactive,
bool *challenge,
DBusError *error);
-
-#endif
diff --git a/src/shared/ratelimit.h b/src/shared/ratelimit.h
index ad00267..58efca7 100644
--- a/src/shared/ratelimit.h
+++ b/src/shared/ratelimit.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooratelimithfoo
-#define fooratelimithfoo
+#pragma once
/***
This file is part of systemd.
@@ -56,5 +55,3 @@ typedef struct RateLimit {
} while (false)
bool ratelimit_test(RateLimit *r);
-
-#endif
diff --git a/src/shared/set.h b/src/shared/set.h
index 18921df..c7b6231 100644
--- a/src/shared/set.h
+++ b/src/shared/set.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foosethfoo
-#define foosethfoo
+#pragma once
/***
This file is part of systemd.
@@ -67,5 +66,3 @@ void* set_last(Set *s);
#define SET_FOREACH_BACKWARDS(e, s, i) \
for ((i) = ITERATOR_LAST, (e) = set_iterate_backwards((s), &(i)); (e); (e) = set_iterate_backwards((s), &(i)))
-
-#endif
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h
index a5a9463..7cca2f5 100644
--- a/src/shared/socket-util.h
+++ b/src/shared/socket-util.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foosocketutilhfoo
-#define foosocketutilhfoo
+#pragma once
/***
This file is part of systemd.
@@ -98,5 +97,3 @@ const char* netlink_family_to_string(int b);
int netlink_family_from_string(const char *s);
bool socket_ipv6_is_supported(void);
-
-#endif
diff --git a/src/shared/spawn-ask-password-agent.h b/src/shared/spawn-ask-password-agent.h
index fa5e7b0..31b4bea 100644
--- a/src/shared/spawn-ask-password-agent.h
+++ b/src/shared/spawn-ask-password-agent.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foospawnaskpasswordagenthfoo
-#define foospawnaskpasswordagenthfoo
+#pragma once
/***
This file is part of systemd.
@@ -24,5 +23,3 @@
int ask_password_agent_open(void);
void ask_password_agent_close(void);
-
-#endif
diff --git a/src/shared/specifier.h b/src/shared/specifier.h
index 57d1fcb..25a27a4 100644
--- a/src/shared/specifier.h
+++ b/src/shared/specifier.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foospecifierhfoo
-#define foospecifierhfoo
+#pragma once
/***
This file is part of systemd.
@@ -33,5 +32,3 @@ typedef struct Specifier {
char *specifier_printf(const char *text, const Specifier table[], void *userdata);
char* specifier_string(char specifier, void *data, void *userdata);
-
-#endif
diff --git a/src/shared/strv.h b/src/shared/strv.h
index 635e92b..ae4e31f 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foostrvhfoo
-#define foostrvhfoo
+#pragma once
/***
This file is part of systemd.
@@ -80,5 +79,3 @@ bool strv_overlap(char **a, char **b);
#define STRV_FOREACH_BACKWARDS(s, l) \
for (; (l) && ((s) >= (l)); (s)--)
-
-#endif
diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
index c6c09dd..f899f86 100644
--- a/src/shared/unit-name.h
+++ b/src/shared/unit-name.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foounitnamehfoo
-#define foounitnamehfoo
+#pragma once
/***
This file is part of systemd.
@@ -92,5 +91,3 @@ char *unit_name_to_path(const char *name);
char *unit_dbus_path_from_name(const char *name);
char *unit_name_mangle(const char *name);
-
-#endif
diff --git a/src/shared/utf8.h b/src/shared/utf8.h
index fec76b4..13d2f6a 100644
--- a/src/shared/utf8.h
+++ b/src/shared/utf8.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooutf8hfoo
-#define fooutf8hfoo
+#pragma once
/***
This file is part of systemd.
@@ -31,5 +30,3 @@ char *utf8_is_printable_n(const char* str, size_t length) _pure_;
char *utf8_filter(const char *s);
char *ascii_filter(const char *s);
-
-#endif
diff --git a/src/shared/util.h b/src/shared/util.h
index 3915904..d25b7ee 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooutilhfoo
-#define fooutilhfoo
+#pragma once
/***
This file is part of systemd.
@@ -531,5 +530,3 @@ void warn_melody(void);
int get_shell(char **ret);
int get_home_dir(char **ret);
-
-#endif
diff --git a/src/shared/utmp-wtmp.h b/src/shared/utmp-wtmp.h
index ab95061..5924023 100644
--- a/src/shared/utmp-wtmp.h
+++ b/src/shared/utmp-wtmp.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef fooutmpwtmphfoo
-#define fooutmpwtmphfoo
+#pragma once
/***
This file is part of systemd.
@@ -34,5 +33,3 @@ int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line);
int utmp_wall(const char *message, bool (*match_tty)(const char *tty));
-
-#endif
diff --git a/src/shared/virt.h b/src/shared/virt.h
index 0b6dc1a..aa6ad35 100644
--- a/src/shared/virt.h
+++ b/src/shared/virt.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foovirthfoo
-#define foovirthfoo
+#pragma once
/***
This file is part of systemd.
@@ -34,5 +33,3 @@ typedef enum Virtualization {
} Virtualization;
Virtualization detect_virtualization(const char **id);
-
-#endif
diff --git a/src/shared/watchdog.h b/src/shared/watchdog.h
index 2e00cb9..b748b15 100644
--- a/src/shared/watchdog.h
+++ b/src/shared/watchdog.h
@@ -1,7 +1,6 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-#ifndef foowatchdoghfoo
-#define foowatchdoghfoo
+#pragma once
/***
This file is part of systemd.
@@ -27,5 +26,3 @@
int watchdog_set_timeout(usec_t *usec);
int watchdog_ping(void);
void watchdog_close(bool disarm);
-
-#endif
--
1.7.9.5
More information about the systemd-devel
mailing list