[systemd-commits] 2 commits - src/backlight src/core src/journal src/libudev src/login src/nss-myhostname src/shared src/sysctl src/systemctl src/udev

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Nov 18 17:31:38 PST 2013


 src/backlight/backlight.c             |    1 -
 src/core/killall.h                    |    5 +----
 src/core/shutdown.c                   |    1 -
 src/core/switch-root.h                |    5 +----
 src/core/syscall-list.h               |    5 +----
 src/core/transaction.h                |    5 +----
 src/journal/journalctl.c              |    1 -
 src/libudev/libudev-device-private.c  |    1 -
 src/login/logind-action.h             |    5 +----
 src/login/logind-button.h             |    5 +----
 src/login/logind-inhibit.c            |    1 -
 src/login/logind-inhibit.h            |    5 +----
 src/nss-myhostname/ifconf.h           |    9 ++-------
 src/nss-myhostname/netlink.c          |    1 -
 src/shared/audit.h                    |    5 +----
 src/shared/capability.h               |    5 +----
 src/shared/cgroup-show.h              |    5 +----
 src/shared/conf-files.h               |    5 +----
 src/shared/hwclock.h                  |    5 +----
 src/shared/label.c                    |    1 -
 src/shared/spawn-polkit-agent.h       |    5 +----
 src/shared/util.c                     |    1 -
 src/sysctl/sysctl.c                   |    1 -
 src/systemctl/systemctl.c             |    1 -
 src/udev/mtd_probe/probe_smartmedia.c |    1 -
 src/udev/v4l_id/v4l_id.c              |    4 ----
 26 files changed, 15 insertions(+), 74 deletions(-)

New commits:
commit 4561be3a64534a911ee405ffb51950a624a0cd3f
Author: Karel Zak <kzak at redhat.com>
Date:   Mon Nov 18 14:48:16 2013 +0100

    Remove duplicate includes

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 9ec29f7..bf76703 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -24,7 +24,6 @@
 #include "fileio.h"
 #include "libudev.h"
 #include "udev-util.h"
-#include "util.h"
 
 static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) {
         struct udev_device *parent;
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index b5eb8b1..bcf2eec 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -24,7 +24,6 @@
 #include <sys/reboot.h>
 #include <linux/reboot.h>
 #include <sys/wait.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include <sys/syscall.h>
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index a509104..c44be74 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -48,7 +48,6 @@
 #include "fileio.h"
 #include "build.h"
 #include "pager.h"
-#include "logs-show.h"
 #include "strv.h"
 #include "journal-internal.h"
 #include "journal-def.h"
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c
index cba08d2..cb4947f 100644
--- a/src/libudev/libudev-device-private.c
+++ b/src/libudev/libudev-device-private.c
@@ -24,7 +24,6 @@
 #include <stdbool.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <string.h>
 #include <sys/stat.h>
 
 #include "libudev.h"
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 3bc4642..26cce8d 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -22,7 +22,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <string.h>
-#include <errno.h>
 #include <unistd.h>
 
 #include "util.h"
diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c
index 47a41f5..d61ecdf 100644
--- a/src/nss-myhostname/netlink.c
+++ b/src/nss-myhostname/netlink.c
@@ -31,7 +31,6 @@
 #include <limits.h>
 #include <arpa/inet.h>
 #include <unistd.h>
-#include <inttypes.h>
 #include <stdlib.h>
 
 #include "ifconf.h"
diff --git a/src/shared/label.c b/src/shared/label.c
index 5c7cc1c..4a26ba9 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -20,7 +20,6 @@
 ***/
 
 #include <errno.h>
-#include <sys/stat.h>
 #include <unistd.h>
 #include <malloc.h>
 #include <sys/socket.h>
diff --git a/src/shared/util.c b/src/shared/util.c
index b77d010..deb74c4 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -41,7 +41,6 @@
 #include <stdarg.h>
 #include <sys/inotify.h>
 #include <sys/poll.h>
-#include <libgen.h>
 #include <ctype.h>
 #include <sys/prctl.h>
 #include <sys/utsname.h>
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 67c7872..449e0ca 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -30,7 +30,6 @@
 #include "log.h"
 #include "strv.h"
 #include "util.h"
-#include "strv.h"
 #include "hashmap.h"
 #include "path-util.h"
 #include "conf-files.h"
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2362f43..2e18636 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -65,7 +65,6 @@
 #include "spawn-polkit-agent.h"
 #include "install.h"
 #include "logs-show.h"
-#include "path-util.h"
 #include "socket-util.h"
 #include "fileio.h"
 #include "bus-util.h"
diff --git a/src/udev/mtd_probe/probe_smartmedia.c b/src/udev/mtd_probe/probe_smartmedia.c
index feadb50..a007cce 100644
--- a/src/udev/mtd_probe/probe_smartmedia.c
+++ b/src/udev/mtd_probe/probe_smartmedia.c
@@ -26,7 +26,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include "mtd_probe.h"
 
 static const uint8_t cis_signature[] = {
diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c
index 8dcb645..d5463b2 100644
--- a/src/udev/v4l_id/v4l_id.c
+++ b/src/udev/v4l_id/v4l_id.c
@@ -18,11 +18,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <sys/types.h>

commit 05d3a176239c1dd67863c70a5b79d9bc14144ef6
Author: Shawn Landden <shawn at churchofgit.com>
Date:   Mon Nov 18 07:58:43 2013 -0800

    use #pragma once instead of foo*foo define guards

diff --git a/src/core/killall.h b/src/core/killall.h
index d08ac14..95b110f 100644
--- a/src/core/killall.h
+++ b/src/core/killall.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fookillallhfoo
-#define fookillallhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -23,5 +22,3 @@
 ***/
 
 void broadcast_signal(int sig, bool wait);
-
-#endif
diff --git a/src/core/switch-root.h b/src/core/switch-root.h
index 0c4cd1e..ab493b5 100644
--- a/src/core/switch-root.h
+++ b/src/core/switch-root.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooswitchroothfoo
-#define fooswitchroothfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -23,5 +22,3 @@
 ***/
 
 int switch_root(const char *switch_root);
-
-#endif
diff --git a/src/core/syscall-list.h b/src/core/syscall-list.h
index 6bb4d91..37efc56 100644
--- a/src/core/syscall-list.h
+++ b/src/core/syscall-list.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foosyscalllisthfoo
-#define foosyscalllisthfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -40,5 +39,3 @@ const char *syscall_to_name(int id);
 int syscall_from_name(const char *name);
 
 int syscall_max(void);
-
-#endif
diff --git a/src/core/transaction.h b/src/core/transaction.h
index 12f9194..b6ee237 100644
--- a/src/core/transaction.h
+++ b/src/core/transaction.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef footransactionhfoo
-#define footransactionhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -53,5 +52,3 @@ int transaction_add_job_and_dependencies(
 int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusError *e);
 int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
 void transaction_abort(Transaction *tr);
-
-#endif
diff --git a/src/login/logind-action.h b/src/login/logind-action.h
index 5527136..74f7144 100644
--- a/src/login/logind-action.h
+++ b/src/login/logind-action.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindactionhfoo
-#define foologindactionhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -50,5 +49,3 @@ const char* handle_action_to_string(HandleAction h) _const_;
 HandleAction handle_action_from_string(const char *s) _pure_;
 
 int config_parse_handle_action(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-
-#endif
diff --git a/src/login/logind-button.h b/src/login/logind-button.h
index 83bf1fc..824106c 100644
--- a/src/login/logind-button.h
+++ b/src/login/logind-button.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindbuttonhfoo
-#define foologindbuttonhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -45,5 +44,3 @@ void button_free(Button*b);
 int button_open(Button *b);
 int button_recheck(Button *b);
 int button_set_seat(Button *b, const char *sn);
-
-#endif
diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h
index ed3b2eb..da3d7e7 100644
--- a/src/login/logind-inhibit.h
+++ b/src/login/logind-inhibit.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindinhibithfoo
-#define foologindinhibithfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -93,5 +92,3 @@ InhibitWhat inhibit_what_from_string(const char *s);
 
 const char *inhibit_mode_to_string(InhibitMode k);
 InhibitMode inhibit_mode_from_string(const char *s);
-
-#endif
diff --git a/src/nss-myhostname/ifconf.h b/src/nss-myhostname/ifconf.h
index 2764a0a..cd598d2 100644
--- a/src/nss-myhostname/ifconf.h
+++ b/src/nss-myhostname/ifconf.h
@@ -1,9 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooifconfhfoo
-#define fooifconfhfoo
-
-#include <sys/socket.h>
+#pragma once
 
 /***
   This file is part of systemd.
@@ -27,6 +24,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <assert.h>
+#include <sys/socket.h>
 
 struct address {
         unsigned char family;
@@ -68,6 +66,3 @@ static inline int address_compare(const void *_a, const void *_b) {
 
         return 0;
 }
-
-
-#endif
diff --git a/src/shared/audit.h b/src/shared/audit.h
index 490a0b0..0effc0b 100644
--- a/src/shared/audit.h
+++ b/src/shared/audit.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooaudithfoo
-#define fooaudithfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -28,5 +27,3 @@
 
 int audit_session_from_pid(pid_t pid, uint32_t *id);
 int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
-
-#endif
diff --git a/src/shared/capability.h b/src/shared/capability.h
index 6cb31bb..59469e5 100644
--- a/src/shared/capability.h
+++ b/src/shared/capability.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foocapabilityhfoo
-#define foocapabilityhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -29,5 +28,3 @@ unsigned long cap_last_cap(void);
 int have_effective_cap(int value);
 int capability_bounding_set_drop(uint64_t drop, bool right_now);
 int capability_bounding_set_drop_usermode(uint64_t drop);
-
-#endif
diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h
index 72bc8a6..3146f56 100644
--- a/src/shared/cgroup-show.h
+++ b/src/shared/cgroup-show.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foocgroupshowhfoo
-#define foocgroupshowhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -32,5 +31,3 @@ int show_cgroup(const char *controller, const char *path, const char *prefix, un
 
 int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, unsigned n_columns, bool kernel_threads, const pid_t extra_pids[], unsigned n_extra_pids, OutputFlags flags);
 int show_cgroup_and_extra(const char *controller, const char *path, const char *prefix, unsigned n_columns, bool kernel_threads, const pid_t extra_pids[], unsigned n_extra_pids, OutputFlags flags);
-
-#endif
diff --git a/src/shared/conf-files.h b/src/shared/conf-files.h
index 3bd3d2f..368c112 100644
--- a/src/shared/conf-files.h
+++ b/src/shared/conf-files.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooconffileshfoo
-#define fooconffileshfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -28,5 +27,3 @@
 int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...);
 int conf_files_list_strv(char ***strv, const char *suffix, const char *root, const char* const* dirs);
 int conf_files_list_nulstr(char ***strv, const char *suffix, const char *root, const char *dirs);
-
-#endif
diff --git a/src/shared/hwclock.h b/src/shared/hwclock.h
index b2bdc78..4330b8e 100644
--- a/src/shared/hwclock.h
+++ b/src/shared/hwclock.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foohwclockhfoo
-#define foohwclockhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -27,5 +26,3 @@ int hwclock_set_timezone(int *min);
 int hwclock_reset_timezone(void);
 int hwclock_get_time(struct tm *tm);
 int hwclock_set_time(const struct tm *tm);
-
-#endif
diff --git a/src/shared/spawn-polkit-agent.h b/src/shared/spawn-polkit-agent.h
index b91d20f..c3bc1b8 100644
--- a/src/shared/spawn-polkit-agent.h
+++ b/src/shared/spawn-polkit-agent.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foospawnpolkitagenthfoo
-#define foospawnpolkitagenthfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -24,5 +23,3 @@
 
 int polkit_agent_open(void);
 void polkit_agent_close(void);
-
-#endif



More information about the systemd-commits mailing list