chiark / gitweb /
Prep v224: Major cleanup of unneeded functions and some source files.
authorSven Eden <yamakuzure@gmx.net>
Tue, 3 Jan 2017 10:22:56 +0000 (11:22 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:18:46 +0000 (10:18 +0100)
47 files changed:
Makefile-man.am
Makefile.am
src/basic/audit.c
src/basic/audit.h
src/basic/capability.c
src/basic/capability.h
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/basic/fileio.c
src/basic/fileio.h
src/basic/hashmap.c
src/basic/hostname-util.c
src/basic/hostname-util.h
src/basic/label.c
src/basic/label.h
src/basic/log.c
src/basic/log.h
src/basic/mkdir-label.c
src/basic/mkdir.h
src/basic/path-util.c
src/basic/path-util.h
src/basic/process-util.c
src/basic/process-util.h
src/basic/selinux-util.c
src/basic/selinux-util.h
src/basic/set.h
src/basic/signal-util.c
src/basic/signal-util.h
src/basic/smack-util.c
src/basic/smack-util.h
src/basic/strv.c
src/basic/strv.h
src/basic/terminal-util.c
src/basic/terminal-util.h
src/basic/time-util.c
src/basic/time-util.h
src/basic/unit-name.c
src/basic/unit-name.h
src/basic/virt.c
src/basic/virt.h
src/libelogind/sd-bus/bus-kernel.c
src/libelogind/sd-bus/bus-kernel.h
src/shared/apparmor-util.c [deleted file]
src/shared/bus-util.c
src/shared/bus-util.h
src/shared/seccomp-util.c [deleted file]
src/shared/seccomp-util.h [deleted file]

index 35eec7798023da3cbc0be91434d2335e4f8fc576..845f96a41295fa28494004e9ad0a660a78f88b9f 100644 (file)
@@ -363,15 +363,6 @@ man/sd_session_is_remote.html: man/sd_session_is_active.html
 
 endif
 
 
 endif
 
-if HAVE_PYTHON
-MANPAGES += \
-       man/systemd.index.7
-MANPAGES_ALIAS += \
-       #
-
-
-endif
-
 # Really, do not edit this file.
 
 EXTRA_DIST += \
 # Really, do not edit this file.
 
 EXTRA_DIST += \
index 6234d4bff938db82d2c6bed36b4a7de49ecd9dd5..54c2aeeafd87c363a9f0fa92853f9e7bbe90c2a3 100644 (file)
@@ -397,8 +397,6 @@ libshared_la_SOURCES = \
        src/shared/pager.h \
        src/shared/spawn-polkit-agent.c \
        src/shared/spawn-polkit-agent.h \
        src/shared/pager.h \
        src/shared/spawn-polkit-agent.c \
        src/shared/spawn-polkit-agent.h \
-       src/shared/apparmor-util.c \
-       src/shared/apparmor-util.h \
        src/shared/clean-ipc.c \
        src/shared/clean-ipc.h \
        src/shared/cgroup-show.c \
        src/shared/clean-ipc.c \
        src/shared/clean-ipc.h \
        src/shared/cgroup-show.c \
@@ -406,12 +404,6 @@ libshared_la_SOURCES = \
        src/shared/bus-util.c \
        src/shared/bus-util.h
 
        src/shared/bus-util.c \
        src/shared/bus-util.h
 
-if HAVE_SECCOMP
-libshared_la_SOURCES += \
-       src/shared/seccomp-util.h \
-       src/shared/seccomp-util.c
-endif
-
 if HAVE_ACL
 libshared_la_SOURCES += \
        src/shared/acl-util.c \
 if HAVE_ACL
 libshared_la_SOURCES += \
        src/shared/acl-util.c \
index 54148fcf1836a40c0062a649f6ea676d77a9a2b8..b10480638e8221c615e30e212c839d0ac191548a 100644 (file)
@@ -75,6 +75,8 @@ int audit_loginuid_from_pid(pid_t pid, uid_t *uid) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 bool use_audit(void) {
         static int cached_use = -1;
 
 bool use_audit(void) {
         static int cached_use = -1;
 
@@ -92,3 +94,4 @@ bool use_audit(void) {
 
         return cached_use;
 }
 
         return cached_use;
 }
+#endif // 0
index 6de331c73e5f8b4d341a4680be9c8a35c3c31a42..bc5f83bcb8d77e707b9b074b82e6f33ec787d1db 100644 (file)
@@ -30,4 +30,4 @@
 int audit_session_from_pid(pid_t pid, uint32_t *id);
 int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
 
 int audit_session_from_pid(pid_t pid, uint32_t *id);
 int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
 
-bool use_audit(void);
+// UNNEEDED bool use_audit(void);
index 3963753d4de8630ceab8c0673a0b8d5231fa7def..91ccb27796f2bb74ee0bfd52e3c80592d441b16a 100644 (file)
@@ -32,6 +32,8 @@
 #include "fileio.h"
 #include "capability.h"
 
 #include "fileio.h"
 #include "capability.h"
 
+/// UNNEEDED by elogind
+#if 0
 int have_effective_cap(int value) {
         _cleanup_cap_free_ cap_t cap;
         cap_flag_value_t fv;
 int have_effective_cap(int value) {
         _cleanup_cap_free_ cap_t cap;
         cap_flag_value_t fv;
@@ -45,6 +47,7 @@ int have_effective_cap(int value) {
         else
                 return fv == CAP_SET;
 }
         else
                 return fv == CAP_SET;
 }
+#endif // 0
 
 unsigned long cap_last_cap(void) {
         static thread_local unsigned long saved;
 
 unsigned long cap_last_cap(void) {
         static thread_local unsigned long saved;
@@ -173,6 +176,8 @@ finish:
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int drop_from_file(const char *fn, uint64_t drop) {
         int r, k;
         uint32_t hi, lo;
 static int drop_from_file(const char *fn, uint64_t drop) {
         int r, k;
         uint32_t hi, lo;
@@ -224,8 +229,6 @@ int capability_bounding_set_drop_usermode(uint64_t drop) {
         return r;
 }
 
         return r;
 }
 
-/// UNNEEDED by elogind
-#if 0
 int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) {
         _cleanup_cap_free_ cap_t d = NULL;
         unsigned i, j = 0;
 int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) {
         _cleanup_cap_free_ cap_t d = NULL;
         unsigned i, j = 0;
index 01a2858352157a480d9ccf94fb2ebd17d2bae5bc..0d6b33b8bb69cb97d4408d2c0c1637b30abf4fe2 100644 (file)
@@ -27,9 +27,9 @@
 #include "util.h"
 
 unsigned long cap_last_cap(void);
 #include "util.h"
 
 unsigned long cap_last_cap(void);
-int have_effective_cap(int value);
+// UNNEEDED int have_effective_cap(int value);
 int capability_bounding_set_drop(uint64_t drop, bool right_now);
 int capability_bounding_set_drop(uint64_t drop, bool right_now);
-int capability_bounding_set_drop_usermode(uint64_t drop);
+// UNNEEDED int capability_bounding_set_drop_usermode(uint64_t drop);
 
 // UNNEEDED int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
 
 
 // UNNEEDED int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
 
index 4d321e30b3e30d30fa5ecc54f8ebeb74c945d96c..479254159e54c6b05f2e021fbe89adfacac47592 100644 (file)
@@ -615,6 +615,8 @@ int cg_create(const char *controller, const char *path) {
         return 1;
 }
 
         return 1;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int cg_create_and_attach(const char *controller, const char *path, pid_t pid) {
         int r, q;
 
 int cg_create_and_attach(const char *controller, const char *path, pid_t pid) {
         int r, q;
 
@@ -631,6 +633,7 @@ int cg_create_and_attach(const char *controller, const char *path, pid_t pid) {
         /* This does not remove the cgroup on failure */
         return r;
 }
         /* This does not remove the cgroup on failure */
         return r;
 }
+#endif // 0
 
 int cg_attach(const char *controller, const char *path, pid_t pid) {
         _cleanup_free_ char *fs = NULL;
 
 int cg_attach(const char *controller, const char *path, pid_t pid) {
         _cleanup_free_ char *fs = NULL;
@@ -676,6 +679,8 @@ int cg_attach_fallback(const char *controller, const char *path, pid_t pid) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int cg_set_group_access(
                 const char *controller,
                 const char *path,
 int cg_set_group_access(
                 const char *controller,
                 const char *path,
@@ -732,6 +737,7 @@ int cg_set_task_access(
 
         return chmod_and_chown(procs, mode, uid, gid);
 }
 
         return chmod_and_chown(procs, mode, uid, gid);
 }
+#endif // 0
 
 int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
         _cleanup_fclose_ FILE *f = NULL;
 
 int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
         _cleanup_fclose_ FILE *f = NULL;
@@ -806,6 +812,8 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
         return -ENOENT;
 }
 
         return -ENOENT;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int cg_install_release_agent(const char *controller, const char *agent) {
         _cleanup_free_ char *fs = NULL, *contents = NULL;
         char *sc;
 int cg_install_release_agent(const char *controller, const char *agent) {
         _cleanup_free_ char *fs = NULL, *contents = NULL;
         char *sc;
@@ -881,6 +889,7 @@ int cg_uninstall_release_agent(const char *controller) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int cg_is_empty(const char *controller, const char *path, bool ignore_self) {
         _cleanup_fclose_ FILE *f = NULL;
 
 int cg_is_empty(const char *controller, const char *path, bool ignore_self) {
         _cleanup_fclose_ FILE *f = NULL;
@@ -1713,7 +1722,6 @@ int cg_slice_to_path(const char *unit, char **ret) {
 
         return 0;
 }
 
         return 0;
 }
-#endif // 0
 
 int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value) {
         _cleanup_free_ char *p = NULL;
 
 int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value) {
         _cleanup_free_ char *p = NULL;
@@ -1736,6 +1744,7 @@ int cg_get_attribute(const char *controller, const char *path, const char *attri
 
         return read_one_line_file(p, ret);
 }
 
         return read_one_line_file(p, ret);
 }
+#endif // 0
 
 static const char mask_names[] =
         "cpu\0"
 
 static const char mask_names[] =
         "cpu\0"
@@ -1744,6 +1753,8 @@ static const char mask_names[] =
         "memory\0"
         "devices\0";
 
         "memory\0"
         "devices\0";
 
+/// UNNEEDED by elogind
+#if 0
 int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask mask, const char *path) {
         CGroupControllerMask bit = 1;
         const char *n;
 int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask mask, const char *path) {
         CGroupControllerMask bit = 1;
         const char *n;
@@ -1770,6 +1781,7 @@ int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask ma
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid, cg_migrate_callback_t path_callback, void *userdata) {
         CGroupControllerMask bit = 1;
 
 int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid, cg_migrate_callback_t path_callback, void *userdata) {
         CGroupControllerMask bit = 1;
@@ -1800,6 +1812,8 @@ int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int cg_attach_many_everywhere(CGroupControllerMask supported, const char *path, Set* pids, cg_migrate_callback_t path_callback, void *userdata) {
         Iterator i;
         void *pidp;
 int cg_attach_many_everywhere(CGroupControllerMask supported, const char *path, Set* pids, cg_migrate_callback_t path_callback, void *userdata) {
         Iterator i;
         void *pidp;
@@ -1930,3 +1944,4 @@ int cg_kernel_controllers(Set *controllers) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
index 8a432aad0b4a4e52a137a8073035c971ea5ebb30..d51a8bd26c0648cdd08cc83b123eac06ab2a3fc8 100644 (file)
@@ -82,16 +82,16 @@ int cg_rmdir(const char *controller, const char *path);
 int cg_create(const char *controller, const char *path);
 int cg_attach(const char *controller, const char *path, pid_t pid);
 int cg_attach_fallback(const char *controller, const char *path, pid_t pid);
 int cg_create(const char *controller, const char *path);
 int cg_attach(const char *controller, const char *path, pid_t pid);
 int cg_attach_fallback(const char *controller, const char *path, pid_t pid);
-int cg_create_and_attach(const char *controller, const char *path, pid_t pid);
+// UNNEEDED int cg_create_and_attach(const char *controller, const char *path, pid_t pid);
 
 
-int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value);
-int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret);
+// UNNEEDED int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value);
+// UNNEEDED int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret);
 
 
-int cg_set_group_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
-int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
+// UNNEEDED int cg_set_group_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
+// UNNEEDED int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
 
 
-int cg_install_release_agent(const char *controller, const char *agent);
-int cg_uninstall_release_agent(const char *controller);
+// UNNEEDED int cg_install_release_agent(const char *controller, const char *agent);
+// UNNEEDED int cg_uninstall_release_agent(const char *controller);
 
 int cg_is_empty(const char *controller, const char *path, bool ignore_self);
 int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self);
 
 int cg_is_empty(const char *controller, const char *path, bool ignore_self);
 int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self);
@@ -128,12 +128,12 @@ bool cg_controller_is_valid(const char *p);
 
 typedef const char* (*cg_migrate_callback_t)(CGroupControllerMask mask, void *userdata);
 
 
 typedef const char* (*cg_migrate_callback_t)(CGroupControllerMask mask, void *userdata);
 
-int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask mask, const char *path);
+// UNNEEDED int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask mask, const char *path);
 int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata);
 int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata);
-int cg_attach_many_everywhere(CGroupControllerMask supported, const char *path, Set* pids, cg_migrate_callback_t callback, void *userdata);
-int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, const char *to, cg_migrate_callback_t callback, void *userdata);
-int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bool delete_root);
+// UNNEEDED int cg_attach_many_everywhere(CGroupControllerMask supported, const char *path, Set* pids, cg_migrate_callback_t callback, void *userdata);
+// UNNEEDED int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, const char *to, cg_migrate_callback_t callback, void *userdata);
+// UNNEEDED int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bool delete_root);
 
 
-CGroupControllerMask cg_mask_supported(void);
+// UNNEEDED CGroupControllerMask cg_mask_supported(void);
 
 
-int cg_kernel_controllers(Set *controllers);
+// UNNEEDED int cg_kernel_controllers(Set *controllers);
index 718ed3642dca88c5dfe18fe32566940671a30d47..db2c46cfb1d8e76dca4f599d44e41aac42f2143f 100644 (file)
@@ -134,6 +134,8 @@ int read_one_line_file(const char *fn, char **line) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int verify_one_line_file(const char *fn, const char *line) {
         _cleanup_free_ char *value = NULL;
         int r;
 int verify_one_line_file(const char *fn, const char *line) {
         _cleanup_free_ char *value = NULL;
         int r;
@@ -144,6 +146,7 @@ int verify_one_line_file(const char *fn, const char *line) {
 
         return streq(value, line);
 }
 
         return streq(value, line);
 }
+#endif // 0
 
 int read_full_stream(FILE *f, char **contents, size_t *size) {
         size_t n, l;
 
 int read_full_stream(FILE *f, char **contents, size_t *size) {
         size_t n, l;
index 1fdad924ed1b0054d40a2cc24a868e4adb3c9b0a..edae438e4fc973f1ad6e9bb48a41be3f0fa2513f 100644 (file)
@@ -38,7 +38,7 @@ int read_one_line_file(const char *fn, char **line);
 int read_full_file(const char *fn, char **contents, size_t *size);
 int read_full_stream(FILE *f, char **contents, size_t *size);
 
 int read_full_file(const char *fn, char **contents, size_t *size);
 int read_full_stream(FILE *f, char **contents, size_t *size);
 
-int verify_one_line_file(const char *fn, const char *line);
+// UNNEEDED int verify_one_line_file(const char *fn, const char *line);
 
 int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
 int load_env_file(FILE *f, const char *fname, const char *separator, char ***l);
 
 int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
 int load_env_file(FILE *f, const char *fname, const char *separator, char ***l);
index 55e198960b03e8a76197e01b50bd162a0013f99f..83c76ae0dd4435ddfcdcdb3feb6ece240466a2e2 100644 (file)
@@ -1455,6 +1455,8 @@ int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new_key,
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int set_remove_and_put(Set *s, const void *old_key, const void *new_key) {
         struct swap_entries swap;
         struct hashmap_base_entry *e;
 int set_remove_and_put(Set *s, const void *old_key, const void *new_key) {
         struct swap_entries swap;
         struct hashmap_base_entry *e;
@@ -1480,6 +1482,7 @@ int set_remove_and_put(Set *s, const void *old_key, const void *new_key) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value) {
         struct swap_entries swap;
 
 int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value) {
         struct swap_entries swap;
index e336f269fae160cf4c045f1b34b1719ee278b353..8f6a5b4316e4103c48e37cc5d681c63df0510267 100644 (file)
@@ -25,6 +25,8 @@
 #include "util.h"
 #include "hostname-util.h"
 
 #include "util.h"
 #include "hostname-util.h"
 
+/// UNNEEDED by elogind
+#if 0
 bool hostname_is_set(void) {
         struct utsname u;
 
 bool hostname_is_set(void) {
         struct utsname u;
 
@@ -50,6 +52,7 @@ char* gethostname_malloc(void) {
 
         return strdup(u.nodename);
 }
 
         return strdup(u.nodename);
 }
+#endif // 0
 
 static bool hostname_valid_char(char c) {
         return
 
 static bool hostname_valid_char(char c) {
         return
@@ -142,6 +145,8 @@ bool is_localhost(const char *hostname) {
                endswith(hostname, ".localdomain.");
 }
 
                endswith(hostname, ".localdomain.");
 }
 
+/// UNNEEDED by elogind
+#if 0
 int sethostname_idempotent(const char *s) {
         char buf[HOST_NAME_MAX + 1] = {};
 
 int sethostname_idempotent(const char *s) {
         char buf[HOST_NAME_MAX + 1] = {};
 
@@ -191,3 +196,4 @@ int read_hostname_config(const char *path, char **hostname) {
         *hostname = name;
         return 0;
 }
         *hostname = name;
         return 0;
 }
+#endif // 0
index 0c4763cf5a377053b085a272e04cce85607b082d..c92b19cdc85bb106fd29c3346f5e7d695cd6b950 100644 (file)
 
 #include "macro.h"
 
 
 #include "macro.h"
 
-bool hostname_is_set(void);
+// UNNEEDED bool hostname_is_set(void);
 
 
-char* gethostname_malloc(void);
+// UNNEEDED char* gethostname_malloc(void);
 
 bool hostname_is_valid(const char *s) _pure_;
 char* hostname_cleanup(char *s, bool lowercase);
 
 bool is_localhost(const char *hostname);
 
 
 bool hostname_is_valid(const char *s) _pure_;
 char* hostname_cleanup(char *s, bool lowercase);
 
 bool is_localhost(const char *hostname);
 
-int sethostname_idempotent(const char *s);
+// UNNEEDED int sethostname_idempotent(const char *s);
 
 
-int read_hostname_config(const char *path, char **hostname);
+// UNNEEDED int read_hostname_config(const char *path, char **hostname);
index 82f10b21bd7142ed2adddd83a186afc67b28be0c..73c15cb63365f4e2c96cba498e0cca2b80a74e48 100644 (file)
@@ -58,6 +58,8 @@ int mkdir_label(const char *path, mode_t mode) {
         return mac_smack_fix(path, false, false);
 }
 
         return mac_smack_fix(path, false, false);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int symlink_label(const char *old_path, const char *new_path) {
         int r;
 
 int symlink_label(const char *old_path, const char *new_path) {
         int r;
 
@@ -78,3 +80,4 @@ int symlink_label(const char *old_path, const char *new_path) {
 
         return mac_smack_fix(new_path, false, false);
 }
 
         return mac_smack_fix(new_path, false, false);
 }
+#endif // 0
index 8070bcb021af7e000eb86dfc0827ac7427951814..455a729ea7256ba0eb73ae4699a569c36a22d9c6 100644 (file)
@@ -27,4 +27,4 @@
 int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 
 int mkdir_label(const char *path, mode_t mode);
 int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 
 int mkdir_label(const char *path, mode_t mode);
-int symlink_label(const char *old_path, const char *new_path);
+// UNNEEDED int symlink_label(const char *old_path, const char *new_path);
index b96afc4de4ffb93e982da40505f02d526f40e8e4..e51b4e0b87940dd3f03c7552a1811666bb3e2795 100644 (file)
@@ -295,9 +295,12 @@ void log_close(void) {
         log_close_console();
 }
 
         log_close_console();
 }
 
+/// UNNEEDED by elogind
+#if 0
 void log_forget_fds(void) {
         console_fd = kmsg_fd = syslog_fd = journal_fd = -1;
 }
 void log_forget_fds(void) {
         console_fd = kmsg_fd = syslog_fd = journal_fd = -1;
 }
+#endif // 0
 
 void log_set_max_level(int level) {
         assert((level & LOG_PRIMASK) == level);
 
 void log_set_max_level(int level) {
         assert((level & LOG_PRIMASK) == level);
@@ -1061,6 +1064,8 @@ static const char *const log_target_table[_LOG_TARGET_MAX] = {
 
 DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);
 
 
 DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);
 
+/// UNNEEDED by elogind
+#if 0
 void log_received_signal(int level, const struct signalfd_siginfo *si) {
         if (si->ssi_pid > 0) {
                 _cleanup_free_ char *p = NULL;
 void log_received_signal(int level, const struct signalfd_siginfo *si) {
         if (si->ssi_pid > 0) {
                 _cleanup_free_ char *p = NULL;
@@ -1081,6 +1086,7 @@ void log_received_signal(int level, const struct signalfd_siginfo *si) {
 void log_set_upgrade_syslog_to_journal(bool b) {
         upgrade_syslog_to_journal = b;
 }
 void log_set_upgrade_syslog_to_journal(bool b) {
         upgrade_syslog_to_journal = b;
 }
+#endif // 0
 
 int log_syntax_internal(
                 const char *unit,
 
 int log_syntax_internal(
                 const char *unit,
index 569762d083aee8b10cf8d571ba2698a4d0092a30..3ed6a0e8da6cc3b75b2caf3329a6d4ea9f4d661f 100644 (file)
@@ -66,7 +66,7 @@ int log_get_max_level(void) _pure_;
 
 int log_open(void);
 void log_close(void);
 
 int log_open(void);
 void log_close(void);
-void log_forget_fds(void);
+// UNNEEDED void log_forget_fds(void);
 
 void log_close_syslog(void);
 void log_close_journal(void);
 
 void log_close_syslog(void);
 void log_close_journal(void);
@@ -205,9 +205,9 @@ LogTarget log_target_from_string(const char *s) _pure_;
 #define LOG_MESSAGE(fmt, ...) "MESSAGE=" fmt, ##__VA_ARGS__
 #define LOG_MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(x)
 
 #define LOG_MESSAGE(fmt, ...) "MESSAGE=" fmt, ##__VA_ARGS__
 #define LOG_MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(x)
 
-void log_received_signal(int level, const struct signalfd_siginfo *si);
+// UNNEEDED void log_received_signal(int level, const struct signalfd_siginfo *si);
 
 
-void log_set_upgrade_syslog_to_journal(bool b);
+// UNNEEDED void log_set_upgrade_syslog_to_journal(bool b);
 
 int log_syntax_internal(
                 const char *unit,
 
 int log_syntax_internal(
                 const char *unit,
index 221dd67eb2f139346370cc21bdd68af34f30261b..66978413c0de3046d2804ba9aef8bebe51f71425 100644 (file)
@@ -3,7 +3,8 @@
 /***
   This file is part of systemd.
 
 /***
   This file is part of systemd.
 
-  Copyright 2014 Zbigniew JÄ™drzejewski-Szmek
+  Copyright 2010 Lennart Poettering
+  Copyright 2013 Kay Sievers
 
   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
 
   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
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <fcntl.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <stdlib.h>
 #include <stdio.h>
 
 #include <stdio.h>
 
-#include "util.h"
-#include "formats-util.h"
+#include "label.h"
+#include "mkdir.h"
 
 
-int main(int argc, char** argv) {
-        const char *p = argv[1] ?: "/tmp";
-        char *pattern = strjoina(p, "/systemd-test-XXXXXX");
-        _cleanup_close_ int fd, fd2;
-        _cleanup_free_ char *cmd, *cmd2;
-
-        fd = open_tmpfile(p, O_RDWR|O_CLOEXEC);
-        assert_se(fd >= 0);
-
-        assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd) > 0);
-        system(cmd);
-
-        fd2 = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC);
-        assert_se(fd >= 0);
-        assert_se(unlink(pattern) == 0);
+int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) {
+        return mkdir_safe_internal(path, mode, uid, gid, mkdir_label);
+}
 
 
-        assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd2) > 0);
-        system(cmd2);
+/// UNNEEDED by elogind
+#if 0
+int mkdir_parents_label(const char *path, mode_t mode) {
+        return mkdir_parents_internal(NULL, path, mode, mkdir_label);
+}
+#endif // 0
 
 
-        return 0;
+int mkdir_p_label(const char *path, mode_t mode) {
+        return mkdir_p_internal(NULL, path, mode, mkdir_label);
 }
 }
index 2392d1fd1b39fe4e05589a0822802195dfb4a46a..9a554c1ef7ba6dc0116df4daaddf57c68936166c 100644 (file)
@@ -30,7 +30,7 @@ int mkdir_p(const char *path, mode_t mode);
 
 /* mandatory access control(MAC) versions */
 int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
 
 /* mandatory access control(MAC) versions */
 int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int mkdir_parents_label(const char *path, mode_t mode);
+// UNNEEDED int mkdir_parents_label(const char *path, mode_t mode);
 int mkdir_p_label(const char *path, mode_t mode);
 
 /* internally used */
 int mkdir_p_label(const char *path, mode_t mode);
 
 /* internally used */
index cc985b067af03824e9283a5f4d6b37157dd94064..4325f55f236793faf6d523cc1277ef79fe32d487 100644 (file)
@@ -84,6 +84,8 @@ int path_get_parent(const char *path, char **_r) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 char **path_split_and_make_absolute(const char *p) {
         char **l;
         assert(p);
 char **path_split_and_make_absolute(const char *p) {
         char **l;
         assert(p);
@@ -99,6 +101,7 @@ char **path_split_and_make_absolute(const char *p) {
 
         return l;
 }
 
         return l;
 }
+#endif // 0
 
 char *path_make_absolute(const char *p, const char *prefix) {
         assert(p);
 
 char *path_make_absolute(const char *p, const char *prefix) {
         assert(p);
@@ -454,6 +457,8 @@ bool path_equal(const char *a, const char *b) {
         return path_compare(a, b) == 0;
 }
 
         return path_compare(a, b) == 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 bool path_equal_or_files_same(const char *a, const char *b) {
         return path_equal(a, b) || files_same(a, b) > 0;
 }
 bool path_equal_or_files_same(const char *a, const char *b) {
         return path_equal(a, b) || files_same(a, b) > 0;
 }
@@ -473,6 +478,7 @@ char* path_join(const char *root, const char *path, const char *rest) {
                                rest && rest[0] == '/' ? rest+1 : rest,
                                NULL);
 }
                                rest && rest[0] == '/' ? rest+1 : rest,
                                NULL);
 }
+#endif // 0
 
 static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
         char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
 
 static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
         char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
@@ -692,6 +698,8 @@ int path_is_read_only_fs(const char *path) {
         return false;
 }
 
         return false;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int path_is_os_tree(const char *path) {
         char *p;
         int r;
 int path_is_os_tree(const char *path) {
         char *p;
         int r;
@@ -709,6 +717,7 @@ int path_is_os_tree(const char *path) {
 
         return r >= 0;
 }
 
         return r >= 0;
 }
+#endif // 0
 
 int find_binary(const char *name, bool local, char **filename) {
         assert(name);
 
 int find_binary(const char *name, bool local, char **filename) {
         assert(name);
@@ -798,7 +807,6 @@ bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool upd
 
         return changed;
 }
 
         return changed;
 }
-#endif // 0
 
 int fsck_exists(const char *fstype) {
         _cleanup_free_ char *p = NULL, *d = NULL;
 
 int fsck_exists(const char *fstype) {
         _cleanup_free_ char *p = NULL, *d = NULL;
@@ -823,6 +831,7 @@ int fsck_exists(const char *fstype) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 char *prefix_root(const char *root, const char *path) {
         char *n, *p;
 
 char *prefix_root(const char *root, const char *path) {
         char *n, *p;
index 5e6e3db899ab0071b7b2d58dbde987982d8919b2..b692f17abf3a500359a9be2fc6bd8d5bb68cbe55 100644 (file)
@@ -36,7 +36,7 @@
 #endif
 
 bool is_path(const char *p) _pure_;
 #endif
 
 bool is_path(const char *p) _pure_;
-char** path_split_and_make_absolute(const char *p);
+// UNNEEDED char** path_split_and_make_absolute(const char *p);
 int path_get_parent(const char *path, char **parent);
 bool path_is_absolute(const char *p) _pure_;
 char* path_make_absolute(const char *p, const char *prefix);
 int path_get_parent(const char *path, char **parent);
 bool path_is_absolute(const char *p) _pure_;
 char* path_make_absolute(const char *p, const char *prefix);
@@ -46,8 +46,8 @@ char* path_kill_slashes(char *path);
 char* path_startswith(const char *path, const char *prefix) _pure_;
 int path_compare(const char *a, const char *b) _pure_;
 bool path_equal(const char *a, const char *b) _pure_;
 char* path_startswith(const char *path, const char *prefix) _pure_;
 int path_compare(const char *a, const char *b) _pure_;
 bool path_equal(const char *a, const char *b) _pure_;
-bool path_equal_or_files_same(const char *a, const char *b);
-char* path_join(const char *root, const char *path, const char *rest);
+// UNNEEDED bool path_equal_or_files_same(const char *a, const char *b);
+// UNNEEDED char* path_join(const char *root, const char *path, const char *rest);
 
 char** path_strv_make_absolute_cwd(char **l);
 char** path_strv_resolve(char **l, const char *prefix);
 
 char** path_strv_make_absolute_cwd(char **l);
 char** path_strv_resolve(char **l, const char *prefix);
@@ -56,13 +56,13 @@ char** path_strv_resolve_uniq(char **l, const char *prefix);
 int fd_is_mount_point(int fd, const char *filename, int flags);
 int path_is_mount_point(const char *path, int flags);
 int path_is_read_only_fs(const char *path);
 int fd_is_mount_point(int fd, const char *filename, int flags);
 int path_is_mount_point(const char *path, int flags);
 int path_is_read_only_fs(const char *path);
-int path_is_os_tree(const char *path);
+// UNNEEDED int path_is_os_tree(const char *path);
 
 int find_binary(const char *name, bool local, char **filename);
 
 // UNNEEDED bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
 
 
 int find_binary(const char *name, bool local, char **filename);
 
 // UNNEEDED bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
 
-int fsck_exists(const char *fstype);
+// UNNEEDED int fsck_exists(const char *fstype);
 
 /* Iterates through the path prefixes of the specified path, going up
  * the tree, to root. Also returns "" (and not "/"!) for the root
 
 /* Iterates through the path prefixes of the specified path, going up
  * the tree, to root. Also returns "" (and not "/"!) for the root
index 9e7ddca91e75b355dd43feba1e711072f033440d..b05591eb866c0fa747f2aa6448312b6fec7fb360 100644 (file)
@@ -243,6 +243,8 @@ int get_process_exe(pid_t pid, char **name) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int get_process_id(pid_t pid, const char *field, uid_t *uid) {
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX];
 static int get_process_id(pid_t pid, const char *field, uid_t *uid) {
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX];
@@ -281,8 +283,6 @@ int get_process_uid(pid_t pid, uid_t *uid) {
         return get_process_id(pid, "Uid:", uid);
 }
 
         return get_process_id(pid, "Uid:", uid);
 }
 
-/// UNNEEDED by elogind
-#if 0
 int get_process_gid(pid_t pid, gid_t *gid) {
         assert_cc(sizeof(uid_t) == sizeof(gid_t));
         return get_process_id(pid, "Gid:", gid);
 int get_process_gid(pid_t pid, gid_t *gid) {
         assert_cc(sizeof(uid_t) == sizeof(gid_t));
         return get_process_id(pid, "Gid:", gid);
@@ -452,6 +452,8 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid, bool check_exit_cod
         return -EPROTO;
 }
 
         return -EPROTO;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int kill_and_sigcont(pid_t pid, int sig) {
         int r;
 
 int kill_and_sigcont(pid_t pid, int sig) {
         int r;
 
@@ -462,6 +464,7 @@ int kill_and_sigcont(pid_t pid, int sig) {
 
         return r;
 }
 
         return r;
 }
+#endif // 0
 
 int getenv_for_pid(pid_t pid, const char *field, char **_value) {
         _cleanup_fclose_ FILE *f = NULL;
 
 int getenv_for_pid(pid_t pid, const char *field, char **_value) {
         _cleanup_fclose_ FILE *f = NULL;
index 0f0475a81b36f7631b2540ebf13d91f9faa01c26..1482cca34a7cd6595a7a53bd83eb7bcfa4475803 100644 (file)
@@ -45,7 +45,7 @@ int get_process_state(pid_t pid);
 int get_process_comm(pid_t pid, char **name);
 int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line);
 int get_process_exe(pid_t pid, char **name);
 int get_process_comm(pid_t pid, char **name);
 int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line);
 int get_process_exe(pid_t pid, char **name);
-int get_process_uid(pid_t pid, uid_t *uid);
+// UNNEEDED int get_process_uid(pid_t pid, uid_t *uid);
 // UNNEEDED int get_process_gid(pid_t pid, gid_t *gid);
 // UNNEEDED int get_process_capeff(pid_t pid, char **capeff);
 // UNNEEDED int get_process_cwd(pid_t pid, char **cwd);
 // UNNEEDED int get_process_gid(pid_t pid, gid_t *gid);
 // UNNEEDED int get_process_capeff(pid_t pid, char **capeff);
 // UNNEEDED int get_process_cwd(pid_t pid, char **cwd);
@@ -55,9 +55,9 @@ int get_process_uid(pid_t pid, uid_t *uid);
 int wait_for_terminate(pid_t pid, siginfo_t *status);
 int wait_for_terminate_and_warn(const char *name, pid_t pid, bool check_exit_code);
 
 int wait_for_terminate(pid_t pid, siginfo_t *status);
 int wait_for_terminate_and_warn(const char *name, pid_t pid, bool check_exit_code);
 
-int kill_and_sigcont(pid_t pid, int sig);
+// UNNEEDED int kill_and_sigcont(pid_t pid, int sig);
 pid_t get_parent_of_pid(pid_t pid, pid_t *ppid);
 pid_t get_parent_of_pid(pid_t pid, pid_t *ppid);
-void rename_process(const char name[8]);
+// UNNEEDED void rename_process(const char name[8]);
 int is_kernel_thread(pid_t pid);
 int getenv_for_pid(pid_t pid, const char *field, char **_value);
 
 int is_kernel_thread(pid_t pid);
 int getenv_for_pid(pid_t pid, const char *field, char **_value);
 
index 69885d9fc9b8456f19518171c7e93cbc18eaa6ec..03ebab32c5b69368256856da00dee57c439648a9 100644 (file)
@@ -57,11 +57,14 @@ bool mac_selinux_use(void) {
 #endif
 }
 
 #endif
 }
 
+/// UNNEEDED by elogind
+#if 0
 void mac_selinux_retest(void) {
 #ifdef HAVE_SELINUX
         cached_use = -1;
 #endif
 }
 void mac_selinux_retest(void) {
 #ifdef HAVE_SELINUX
         cached_use = -1;
 #endif
 }
+#endif // 0
 
 int mac_selinux_init(const char *prefix) {
         int r = 0;
 
 int mac_selinux_init(const char *prefix) {
         int r = 0;
@@ -109,6 +112,8 @@ int mac_selinux_init(const char *prefix) {
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 void mac_selinux_finish(void) {
 
 #ifdef HAVE_SELINUX
 void mac_selinux_finish(void) {
 
 #ifdef HAVE_SELINUX
@@ -119,6 +124,7 @@ void mac_selinux_finish(void) {
         label_hnd = NULL;
 #endif
 }
         label_hnd = NULL;
 #endif
 }
+#endif // 0
 
 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
 
 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
@@ -187,7 +193,6 @@ int mac_selinux_apply(const char *path, const char *label) {
 #endif
         return 0;
 }
 #endif
         return 0;
 }
-#endif // 0
 
 int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
         int r = -EOPNOTSUPP;
 
 int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
         int r = -EOPNOTSUPP;
@@ -307,6 +312,7 @@ void mac_selinux_free(char *label) {
         freecon((security_context_t) label);
 #endif
 }
         freecon((security_context_t) label);
 #endif
 }
+#endif // 0
 
 int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
         int r = 0;
 
 int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
         int r = 0;
@@ -364,6 +370,8 @@ void mac_selinux_create_file_clear(void) {
 #endif
 }
 
 #endif
 }
 
+/// UNNEEDED by elogind
+#if 0
 int mac_selinux_create_socket_prepare(const char *label) {
 
 #ifdef HAVE_SELINUX
 int mac_selinux_create_socket_prepare(const char *label) {
 
 #ifdef HAVE_SELINUX
@@ -463,3 +471,4 @@ skipped:
 #endif
         return bind(fd, addr, addrlen) < 0 ? -errno : 0;
 }
 #endif
         return bind(fd, addr, addrlen) < 0 ? -errno : 0;
 }
+#endif // 0
index 6f6b08d0f61fad326c58c313582939d79e4ecc4a..e60dac8de82959ce817b198e16a56e4ff702cc11 100644 (file)
 #include <stdbool.h>
 
 bool mac_selinux_use(void);
 #include <stdbool.h>
 
 bool mac_selinux_use(void);
-void mac_selinux_retest(void);
+// UNNEEDED void mac_selinux_retest(void);
 
 int mac_selinux_init(const char *prefix);
 
 int mac_selinux_init(const char *prefix);
-void mac_selinux_finish(void);
+// UNNEEDED void mac_selinux_finish(void);
 
 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 // UNNEEDED int mac_selinux_apply(const char *path, const char *label);
 
 
 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 // UNNEEDED int mac_selinux_apply(const char *path, const char *label);
 
-int mac_selinux_get_create_label_from_exe(const char *exe, char **label);
-int mac_selinux_get_our_label(char **label);
-int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label);
-void mac_selinux_free(char *label);
+// UNNEEDED int mac_selinux_get_create_label_from_exe(const char *exe, char **label);
+// UNNEEDED int mac_selinux_get_our_label(char **label);
+// UNNEEDED int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label);
+// UNNEEDED void mac_selinux_free(char *label);
 
 int mac_selinux_create_file_prepare(const char *path, mode_t mode);
 void mac_selinux_create_file_clear(void);
 
 
 int mac_selinux_create_file_prepare(const char *path, mode_t mode);
 void mac_selinux_create_file_clear(void);
 
-int mac_selinux_create_socket_prepare(const char *label);
-void mac_selinux_create_socket_clear(void);
+// UNNEEDED int mac_selinux_create_socket_prepare(const char *label);
+// UNNEEDED void mac_selinux_create_socket_clear(void);
 
 
-int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
+// UNNEEDED int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
index 1d16999595a96b5d74b9ef6ffed6a17cf7547512..87cfcd8e42c36e8dd6e7735d3b2d445e532f78de 100644 (file)
@@ -63,7 +63,7 @@ static inline void *set_remove(Set *s, const void *key) {
 
 /* no set_remove2 */
 /* no set_remove_value */
 
 /* no set_remove2 */
 /* no set_remove_value */
-int set_remove_and_put(Set *s, const void *old_key, const void *new_key);
+// UNNEEDED int set_remove_and_put(Set *s, const void *old_key, const void *new_key);
 /* no set_remove_and_replace */
 int set_merge(Set *s, Set *other);
 
 /* no set_remove_and_replace */
 int set_merge(Set *s, Set *other);
 
index 90abe8af816d2df154d6ddbc123d0821475bbe87..4bb2177d67129d2e74b3f220f5186465d6551fea 100644 (file)
@@ -112,6 +112,8 @@ int ignore_signals(int sig, ...) {
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int default_signals(int sig, ...) {
 
         static const struct sigaction sa = {
 int default_signals(int sig, ...) {
 
         static const struct sigaction sa = {
@@ -128,6 +130,7 @@ int default_signals(int sig, ...) {
 
         return r;
 }
 
         return r;
 }
+#endif // 0
 
 static int sigset_add_many_ap(sigset_t *ss, va_list ap) {
         int sig, r = 0;
 
 static int sigset_add_many_ap(sigset_t *ss, va_list ap) {
         int sig, r = 0;
index 5e6eb50b07f53ebabdf3d545c5896c5b54bfe6de..705fb47f6ef3d2ed75100519147383e68afe3b9a 100644 (file)
@@ -29,7 +29,7 @@ int reset_all_signal_handlers(void);
 int reset_signal_mask(void);
 
 int ignore_signals(int sig, ...);
 int reset_signal_mask(void);
 
 int ignore_signals(int sig, ...);
-int default_signals(int sig, ...);
+// UNNEEDED int default_signals(int sig, ...);
 int sigaction_many(const struct sigaction *sa, ...);
 
 int sigset_add_many(sigset_t *ss, ...);
 int sigaction_many(const struct sigaction *sa, ...);
 
 int sigset_add_many(sigset_t *ss, ...);
index 047aa294f4c0a11610530adb2dd875ca7ec4ebeb..c09609022664b0af39871bb3442736085c006327 100644 (file)
@@ -65,6 +65,8 @@ int mac_smack_apply(const char *path, const char *label) {
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int mac_smack_apply_fd(int fd, const char *label) {
         int r = 0;
 
 int mac_smack_apply_fd(int fd, const char *label) {
         int r = 0;
 
@@ -146,6 +148,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
 
         return r;
 }
 
         return r;
 }
+#endif // 0
 
 int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
 
 int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
index 50f55b1f4bd8cf2286f66f2ff7aaa33e7ce5226b..6472f86661e9a9b17f28d47928df424dcfe91170 100644 (file)
@@ -30,7 +30,7 @@ bool mac_smack_use(void);
 int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 
 int mac_smack_apply(const char *path, const char *label);
 int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
 
 int mac_smack_apply(const char *path, const char *label);
-int mac_smack_apply_fd(int fd, const char *label);
-int mac_smack_apply_pid(pid_t pid, const char *label);
-int mac_smack_apply_ip_in_fd(int fd, const char *label);
-int mac_smack_apply_ip_out_fd(int fd, const char *label);
+// UNNEEDED int mac_smack_apply_fd(int fd, const char *label);
+// UNNEEDED int mac_smack_apply_pid(pid_t pid, const char *label);
+// UNNEEDED int mac_smack_apply_ip_in_fd(int fd, const char *label);
+// UNNEEDED int mac_smack_apply_ip_out_fd(int fd, const char *label);
index 31d83f3efd9a7e38e8a65ec3bab9f885c48efbc7..5bf066ff00e9199d259729fab14a4692e0c7fcba 100644 (file)
@@ -201,6 +201,8 @@ int strv_extend_strv(char ***a, char **b) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int strv_extend_strv_concat(char ***a, char **b, const char *suffix) {
         int r;
         char **s;
 int strv_extend_strv_concat(char ***a, char **b, const char *suffix) {
         int r;
         char **s;
@@ -221,6 +223,7 @@ int strv_extend_strv_concat(char ***a, char **b, const char *suffix) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 char **strv_split(const char *s, const char *separator) {
         const char *word, *state;
 
 char **strv_split(const char *s, const char *separator) {
         const char *word, *state;
@@ -279,7 +282,6 @@ char **strv_split_newlines(const char *s) {
 
         return l;
 }
 
         return l;
 }
-#endif // 0
 
 int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags) {
         size_t n = 0, allocated = 0;
 
 int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags) {
         size_t n = 0, allocated = 0;
@@ -315,6 +317,7 @@ int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 char *strv_join(char **l, const char *separator) {
         char *r, *e;
 
 char *strv_join(char **l, const char *separator) {
         char *r, *e;
@@ -350,6 +353,8 @@ char *strv_join(char **l, const char *separator) {
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 char *strv_join_quoted(char **l) {
         char *buf = NULL;
         char **s;
 char *strv_join_quoted(char **l) {
         char *buf = NULL;
         char **s;
@@ -386,6 +391,7 @@ char *strv_join_quoted(char **l) {
         free(buf);
         return NULL;
 }
         free(buf);
         return NULL;
 }
+#endif // 0
 
 int strv_push(char ***l, char *value) {
         char **c;
 
 int strv_push(char ***l, char *value) {
         char **c;
index 2a2003c3d7e01e1f18f33bd845ce5c8346b18cd1..9629480d86a703362a4918afdc7bd595d13f9b3b 100644 (file)
@@ -41,7 +41,7 @@ char **strv_copy(char * const *l);
 unsigned strv_length(char * const *l) _pure_;
 
 int strv_extend_strv(char ***a, char **b);
 unsigned strv_length(char * const *l) _pure_;
 
 int strv_extend_strv(char ***a, char **b);
-int strv_extend_strv_concat(char ***a, char **b, const char *suffix);
+// UNNEEDED int strv_extend_strv_concat(char ***a, char **b, const char *suffix);
 int strv_extend(char ***l, const char *value);
 // UNNEEDED int strv_extendf(char ***l, const char *format, ...) _printf_(2,0);
 int strv_push(char ***l, char *value);
 int strv_extend(char ***l, const char *value);
 // UNNEEDED int strv_extendf(char ***l, const char *format, ...) _printf_(2,0);
 int strv_push(char ***l, char *value);
@@ -73,10 +73,10 @@ static inline bool strv_isempty(char * const *l) {
 char **strv_split(const char *s, const char *separator);
 // UNNEEDED char **strv_split_newlines(const char *s);
 
 char **strv_split(const char *s, const char *separator);
 // UNNEEDED char **strv_split_newlines(const char *s);
 
-int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags);
+// UNNEEDED int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags);
 
 char *strv_join(char **l, const char *separator);
 
 char *strv_join(char **l, const char *separator);
-char *strv_join_quoted(char **l);
+// UNNEEDED char *strv_join_quoted(char **l);
 
 char **strv_parse_nulstr(const char *s, size_t l);
 char **strv_split_nulstr(const char *s);
 
 char **strv_parse_nulstr(const char *s, size_t l);
 char **strv_split_nulstr(const char *s);
index 103643614bd9042ad5c8ea22929e29c7c7db5362..3c473dc92668139ae2cc6a6d7a8be818b8cccefc 100644 (file)
@@ -126,6 +126,8 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int ask_char(char *ret, const char *replies, const char *text, ...) {
         int r;
 
 int ask_char(char *ret, const char *replies, const char *text, ...) {
         int r;
 
@@ -174,8 +176,6 @@ int ask_char(char *ret, const char *replies, const char *text, ...) {
         }
 }
 
         }
 }
 
-/// UNNEEDED by elogind
-#if 0
 int ask_string(char **ret, const char *text, ...) {
         assert(ret);
         assert(text);
 int ask_string(char **ret, const char *text, ...) {
         assert(ret);
         assert(text);
@@ -492,6 +492,8 @@ fail:
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int release_terminal(void) {
         static const struct sigaction sa_new = {
                 .sa_handler = SIG_IGN,
 int release_terminal(void) {
         static const struct sigaction sa_new = {
                 .sa_handler = SIG_IGN,
@@ -517,6 +519,7 @@ int release_terminal(void) {
 
         return r;
 }
 
         return r;
 }
+#endif // 0
 
 int terminal_vhangup_fd(int fd) {
         assert(fd >= 0);
 
 int terminal_vhangup_fd(int fd) {
         assert(fd >= 0);
@@ -627,6 +630,8 @@ void warn_melody(void) {
         ioctl(fd, KIOCSOUND, 0);
 }
 
         ioctl(fd, KIOCSOUND, 0);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int make_console_stdio(void) {
         int fd, r;
 
 int make_console_stdio(void) {
         int fd, r;
 
@@ -642,6 +647,7 @@ int make_console_stdio(void) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) {
         static const char status_indent[] = "         "; /* "[" STATUS "] " */
 
 int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) {
         static const char status_indent[] = "         "; /* "[" STATUS "] " */
@@ -810,11 +816,14 @@ bool tty_is_vc_resolve(const char *tty) {
         return tty_is_vc(tty);
 }
 
         return tty_is_vc(tty);
 }
 
+/// UNNEEDED by elogind
+#if 0
 const char *default_term_for_tty(const char *tty) {
         assert(tty);
 
         return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
 }
 const char *default_term_for_tty(const char *tty) {
         assert(tty);
 
         return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
 }
+#endif // 0
 
 int fd_columns(int fd) {
         struct winsize ws = {};
 
 int fd_columns(int fd) {
         struct winsize ws = {};
@@ -969,6 +978,8 @@ int getttyname_malloc(int fd, char **ret) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int getttyname_harder(int fd, char **r) {
         int k;
         char *s = NULL;
 int getttyname_harder(int fd, char **r) {
         int k;
         char *s = NULL;
@@ -985,6 +996,7 @@ int getttyname_harder(int fd, char **r) {
         *r = s;
         return 0;
 }
         *r = s;
         return 0;
 }
+#endif // 0
 
 int get_ctty_devnr(pid_t pid, dev_t *d) {
         int r;
 
 int get_ctty_devnr(pid_t pid, dev_t *d) {
         int r;
index f6eace411c23c1217e44bcb9aadb3faf23967562..5964ae5e6d46e17be948c52a827a8a0d53c7d1ec 100644 (file)
@@ -41,7 +41,7 @@ int reset_terminal(const char *name);
 
 int open_terminal(const char *name, int mode);
 int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
 
 int open_terminal(const char *name, int mode);
 int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
-int release_terminal(void);
+// UNNEEDED int release_terminal(void);
 
 int terminal_vhangup_fd(int fd);
 int terminal_vhangup(const char *name);
 
 int terminal_vhangup_fd(int fd);
 int terminal_vhangup(const char *name);
@@ -49,7 +49,7 @@ int terminal_vhangup(const char *name);
 int chvt(int vt);
 
 int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
 int chvt(int vt);
 
 int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
-int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
+// UNNEEDED int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
 // UNNEEDED int ask_string(char **ret, const char *text, ...) _printf_(2, 3);
 
 int vt_disallocate(const char *name);
 // UNNEEDED int ask_string(char **ret, const char *text, ...) _printf_(2, 3);
 
 int vt_disallocate(const char *name);
@@ -59,13 +59,13 @@ bool tty_is_vc(const char *tty);
 bool tty_is_vc_resolve(const char *tty);
 bool tty_is_console(const char *tty) _pure_;
 int vtnr_from_tty(const char *tty);
 bool tty_is_vc_resolve(const char *tty);
 bool tty_is_console(const char *tty) _pure_;
 int vtnr_from_tty(const char *tty);
-const char *default_term_for_tty(const char *tty);
+// UNNEEDED const char *default_term_for_tty(const char *tty);
 
 void warn_melody(void);
 
 int make_stdio(int fd);
 int make_null_stdio(void);
 
 void warn_melody(void);
 
 int make_stdio(int fd);
 int make_null_stdio(void);
-int make_console_stdio(void);
+// UNNEEDED int make_console_stdio(void);
 
 int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) _printf_(4,0);
 int status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...) _printf_(4,5);
 
 int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) _printf_(4,0);
 int status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...) _printf_(4,5);
@@ -106,4 +106,4 @@ int get_ctty_devnr(pid_t pid, dev_t *d);
 int get_ctty(pid_t, dev_t *_devnr, char **r);
 
 int getttyname_malloc(int fd, char **r);
 int get_ctty(pid_t, dev_t *_devnr, char **r);
 
 int getttyname_malloc(int fd, char **r);
-int getttyname_harder(int fd, char **r);
+// UNNEEDED int getttyname_harder(int fd, char **r);
index ecca227c74bb718cb2b1fc872200ad23b1b7b626..e849ccc57d96841cc3822eeb6293630be941a55b 100644 (file)
@@ -67,6 +67,8 @@ dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u) {
         return ts;
 }
 
         return ts;
 }
 
+/// UNNEEDED by elogind
+#if 0
 dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) {
         int64_t delta;
         assert(ts);
 dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) {
         int64_t delta;
         assert(ts);
@@ -87,6 +89,7 @@ dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) {
 
         return ts;
 }
 
         return ts;
 }
+#endif // 0
 
 usec_t timespec_load(const struct timespec *ts) {
         assert(ts);
 
 usec_t timespec_load(const struct timespec *ts) {
         assert(ts);
@@ -209,9 +212,12 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t) {
         return format_timestamp_internal_us(buf, l, t, false);
 }
 
         return format_timestamp_internal_us(buf, l, t, false);
 }
 
+/// UNNEEDED by elogind
+#if 0
 char *format_timestamp_us_utc(char *buf, size_t l, usec_t t) {
         return format_timestamp_internal_us(buf, l, t, true);
 }
 char *format_timestamp_us_utc(char *buf, size_t l, usec_t t) {
         return format_timestamp_internal_us(buf, l, t, true);
 }
+#endif // 0
 
 char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
         const char *s;
 
 char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
         const char *s;
@@ -386,6 +392,8 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
         return buf;
 }
 
         return buf;
 }
 
+/// UNNEEDED by elogind
+#if 0
 void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) {
 
         assert(f);
 void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) {
 
         assert(f);
@@ -418,8 +426,6 @@ int dual_timestamp_deserialize(const char *value, dual_timestamp *t) {
         return 0;
 }
 
         return 0;
 }
 
-/// UNNEEDED by elogind
-#if 0
 int parse_timestamp(const char *t, usec_t *usec) {
         static const struct {
                 const char *name;
 int parse_timestamp(const char *t, usec_t *usec) {
         static const struct {
                 const char *name;
@@ -985,7 +991,6 @@ bool timezone_is_valid(const char *name) {
 
         return true;
 }
 
         return true;
 }
-#endif // 0
 
 clockid_t clock_boottime_or_monotonic(void) {
         static clockid_t clock = -1;
 
 clockid_t clock_boottime_or_monotonic(void) {
         static clockid_t clock = -1;
@@ -1004,3 +1009,4 @@ clockid_t clock_boottime_or_monotonic(void) {
 
         return clock;
 }
 
         return clock;
 }
+#endif // 0
index 48ca453e644a6f4593ec780cabba7e4c994ebaaf..5913639ec8e4dfb4c1d90a0b6bf8153792691e98 100644 (file)
@@ -73,7 +73,7 @@ usec_t now(clockid_t clock);
 
 dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
 dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u);
 
 dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
 dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u);
-dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u);
+// UNNEEDED dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u);
 
 static inline bool dual_timestamp_is_set(dual_timestamp *ts) {
         return ((ts->realtime > 0 && ts->realtime != USEC_INFINITY) ||
 
 static inline bool dual_timestamp_is_set(dual_timestamp *ts) {
         return ((ts->realtime > 0 && ts->realtime != USEC_INFINITY) ||
@@ -89,12 +89,12 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u);
 char *format_timestamp(char *buf, size_t l, usec_t t);
 // UNNEEDED char *format_timestamp_utc(char *buf, size_t l, usec_t t);
 char *format_timestamp_us(char *buf, size_t l, usec_t t);
 char *format_timestamp(char *buf, size_t l, usec_t t);
 // UNNEEDED char *format_timestamp_utc(char *buf, size_t l, usec_t t);
 char *format_timestamp_us(char *buf, size_t l, usec_t t);
-char *format_timestamp_us_utc(char *buf, size_t l, usec_t t);
+// UNNEEDED char *format_timestamp_us_utc(char *buf, size_t l, usec_t t);
 char *format_timestamp_relative(char *buf, size_t l, usec_t t);
 char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy);
 
 char *format_timestamp_relative(char *buf, size_t l, usec_t t);
 char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy);
 
-void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t);
-int dual_timestamp_deserialize(const char *value, dual_timestamp *t);
+// UNNEEDED void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t);
+// UNNEEDED int dual_timestamp_deserialize(const char *value, dual_timestamp *t);
 
 // UNNEEDED int parse_timestamp(const char *t, usec_t *usec);
 
 
 // UNNEEDED int parse_timestamp(const char *t, usec_t *usec);
 
@@ -106,6 +106,6 @@ int parse_nsec(const char *t, nsec_t *nsec);
 // UNNEEDED int get_timezones(char ***l);
 // UNNEEDED bool timezone_is_valid(const char *name);
 
 // UNNEEDED int get_timezones(char ***l);
 // UNNEEDED bool timezone_is_valid(const char *name);
 
-clockid_t clock_boottime_or_monotonic(void);
+// UNNEEDED clockid_t clock_boottime_or_monotonic(void);
 
 #define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0)
 
 #define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0)
index bf52463d81855fb36fc0848c260e0b96d4a39099..5dac442b1b110fb132ac5ddc5bcd61a1fceaf6f4 100644 (file)
@@ -142,6 +142,8 @@ int unit_name_to_prefix(const char *n, char **ret) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int unit_name_to_instance(const char *n, char **instance) {
         const char *p, *d;
         char *i;
 int unit_name_to_instance(const char *n, char **instance) {
         const char *p, *d;
         char *i;
@@ -194,6 +196,7 @@ int unit_name_to_prefix_and_instance(const char *n, char **ret) {
         *ret = s;
         return 0;
 }
         *ret = s;
         return 0;
 }
+#endif // 0
 
 UnitType unit_name_to_type(const char *n) {
         const char *e;
 
 UnitType unit_name_to_type(const char *n) {
         const char *e;
@@ -208,6 +211,8 @@ UnitType unit_name_to_type(const char *n) {
         return unit_type_from_string(e + 1);
 }
 
         return unit_type_from_string(e + 1);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int unit_name_change_suffix(const char *n, const char *suffix, char **ret) {
         char *e, *s;
         size_t a, b;
 int unit_name_change_suffix(const char *n, const char *suffix, char **ret) {
         char *e, *s;
         size_t a, b;
@@ -236,6 +241,7 @@ int unit_name_change_suffix(const char *n, const char *suffix, char **ret) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret) {
         char *s;
 
 int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret) {
         char *s;
@@ -437,6 +443,8 @@ int unit_name_path_unescape(const char *f, char **ret) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int unit_name_replace_instance(const char *f, const char *i, char **ret) {
         const char *p, *e;
         char *s;
 int unit_name_replace_instance(const char *f, const char *i, char **ret) {
         const char *p, *e;
         char *s;
@@ -492,6 +500,7 @@ int unit_name_template(const char *f, char **ret) {
         *ret = s;
         return 0;
 }
         *ret = s;
         return 0;
 }
+#endif // 0
 
 int unit_name_from_path(const char *path, const char *suffix, char **ret) {
         _cleanup_free_ char *p = NULL;
 
 int unit_name_from_path(const char *path, const char *suffix, char **ret) {
         _cleanup_free_ char *p = NULL;
@@ -517,6 +526,8 @@ int unit_name_from_path(const char *path, const char *suffix, char **ret) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int unit_name_from_path_instance(const char *prefix, const char *path, const char *suffix, char **ret) {
         _cleanup_free_ char *p = NULL;
         char *s;
 int unit_name_from_path_instance(const char *prefix, const char *path, const char *suffix, char **ret) {
         _cleanup_free_ char *p = NULL;
         char *s;
@@ -557,6 +568,7 @@ int unit_name_to_path(const char *name, char **ret) {
 
         return unit_name_path_unescape(prefix, ret);
 }
 
         return unit_name_path_unescape(prefix, ret);
 }
+#endif // 0
 
 char *unit_dbus_path_from_name(const char *name) {
         _cleanup_free_ char *e = NULL;
 
 char *unit_dbus_path_from_name(const char *name) {
         _cleanup_free_ char *e = NULL;
@@ -671,6 +683,8 @@ int unit_name_mangle_with_suffix(const char *name, UnitNameMangle allow_globs, c
         return 1;
 }
 
         return 1;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int slice_build_parent_slice(const char *slice, char **ret) {
         char *s, *dash;
 
 int slice_build_parent_slice(const char *slice, char **ret) {
         char *s, *dash;
 
@@ -703,6 +717,7 @@ int slice_build_parent_slice(const char *slice, char **ret) {
         *ret = s;
         return 1;
 }
         *ret = s;
         return 1;
 }
+#endif // 0
 
 int slice_build_subslice(const char *slice, const char*name, char **ret) {
         char *subslice;
 
 int slice_build_subslice(const char *slice, const char*name, char **ret) {
         char *subslice;
index b2043d0870b0f9deb2a9219bc786bacfb071354a..2a954e53982b2676d3240adc63deaa4aff9f5f96 100644 (file)
@@ -127,12 +127,12 @@ static inline int unit_prefix_and_instance_is_valid(const char *p) {
 }
 
 int unit_name_to_prefix(const char *n, char **prefix);
 }
 
 int unit_name_to_prefix(const char *n, char **prefix);
-int unit_name_to_instance(const char *n, char **instance);
-int unit_name_to_prefix_and_instance(const char *n, char **ret);
+// UNNEEDED int unit_name_to_instance(const char *n, char **instance);
+// UNNEEDED int unit_name_to_prefix_and_instance(const char *n, char **ret);
 
 UnitType unit_name_to_type(const char *n) _pure_;
 
 
 UnitType unit_name_to_type(const char *n) _pure_;
 
-int unit_name_change_suffix(const char *n, const char *suffix, char **ret);
+// UNNEEDED int unit_name_change_suffix(const char *n, const char *suffix, char **ret);
 
 int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret);
 
 
 int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret);
 
@@ -141,13 +141,13 @@ int unit_name_unescape(const char *f, char **ret);
 int unit_name_path_escape(const char *f, char **ret);
 int unit_name_path_unescape(const char *f, char **ret);
 
 int unit_name_path_escape(const char *f, char **ret);
 int unit_name_path_unescape(const char *f, char **ret);
 
-int unit_name_replace_instance(const char *f, const char *i, char **ret);
+// UNNEEDED int unit_name_replace_instance(const char *f, const char *i, char **ret);
 
 
-int unit_name_template(const char *f, char **ret);
+// UNNEEDED int unit_name_template(const char *f, char **ret);
 
 int unit_name_from_path(const char *path, const char *suffix, char **ret);
 
 int unit_name_from_path(const char *path, const char *suffix, char **ret);
-int unit_name_from_path_instance(const char *prefix, const char *path, const char *suffix, char **ret);
-int unit_name_to_path(const char *name, char **ret);
+// UNNEEDED int unit_name_from_path_instance(const char *prefix, const char *path, const char *suffix, char **ret);
+// UNNEEDED int unit_name_to_path(const char *name, char **ret);
 
 char *unit_dbus_path_from_name(const char *name);
 int unit_name_from_dbus_path(const char *path, char **name);
 
 char *unit_dbus_path_from_name(const char *name);
 int unit_name_from_dbus_path(const char *path, char **name);
@@ -163,7 +163,7 @@ static inline int unit_name_mangle(const char *name, UnitNameMangle allow_globs,
         return unit_name_mangle_with_suffix(name, allow_globs, ".service", ret);
 }
 
         return unit_name_mangle_with_suffix(name, allow_globs, ".service", ret);
 }
 
-int slice_build_parent_slice(const char *slice, char **ret);
+// UNNEEDED int slice_build_parent_slice(const char *slice, char **ret);
 int slice_build_subslice(const char *slice, const char*name, char **subslice);
 bool slice_name_is_valid(const char *name);
 
 int slice_build_subslice(const char *slice, const char*name, char **subslice);
 bool slice_name_is_valid(const char *name);
 
index 1299a75ed54d242ef9b93964b7a24dfe302fff9c..b2383e52658c242c5f25dec13245a9514f9d07a4 100644 (file)
@@ -386,6 +386,8 @@ finish:
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 /* Returns a short identifier for the various VM/container implementations */
 int detect_virtualization(const char **id) {
         int r;
 /* Returns a short identifier for the various VM/container implementations */
 int detect_virtualization(const char **id) {
         int r;
@@ -404,3 +406,4 @@ int detect_virtualization(const char **id) {
 
         return VIRTUALIZATION_NONE;
 }
 
         return VIRTUALIZATION_NONE;
 }
+#endif // 0
index 4ec33946cce6b6cc56e3079c255a1d7250aafaff..0f390981dff24028527d87611f1a61081b3a8fec 100644 (file)
@@ -1,9 +1,11 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
+#pragma once
+
 /***
   This file is part of systemd.
 
 /***
   This file is part of systemd.
 
-  Copyright 2014 Tom Gundersen <teg@jklm.no>
+  Copyright 2011 Lennart Poettering
 
   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
 
   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
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#pragma once
-
-typedef struct VxLan VxLan;
-
-#include "networkd-netdev.h"
-
-#include "in-addr-util.h"
-
-#define VXLAN_VID_MAX (1u << 24) - 1
+int detect_vm(const char **id);
+int detect_container(const char **id);
 
 
-struct VxLan {
-        NetDev meta;
-
-        uint64_t id;
-
-        int family;
-        union in_addr_union group;
-
-        unsigned tos;
-        unsigned ttl;
-
-        usec_t fdb_ageing;
-
-        bool learning;
-        bool arp_proxy;
-        bool route_short_circuit;
-        bool l2miss;
-        bool l3miss;
-        bool udpcsum;
-        bool udp6zerocsumtx;
-        bool udp6zerocsumrx;
-        bool group_policy;
+enum {
+        VIRTUALIZATION_NONE = 0,
+        VIRTUALIZATION_VM,
+        VIRTUALIZATION_CONTAINER,
+        _VIRTUALIZATION_MAX,
+        _VIRTUALIZATION_INVALID = -1
 };
 
 };
 
-extern const NetDevVTable vxlan_vtable;
-
-int config_parse_vxlan_group_address(const char *unit,
-                                     const char *filename,
-                                     unsigned line,
-                                     const char *section,
-                                     unsigned section_line,
-                                     const char *lvalue,
-                                     int ltype,
-                                     const char *rvalue,
-                                     void *data,
-                                     void *userdata);
+// UNNEEDED int detect_virtualization(const char **id);
index 6ac5ebc3daef321626c418a13afb532e67270e7f..89d7023d9187cfbfb8e6086b0f94f659c9cd8460 100644 (file)
@@ -1556,6 +1556,8 @@ uint64_t attach_flags_to_kdbus(uint64_t mask) {
         return m;
 }
 
         return m;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_kernel_create_bus(const char *name, bool world, char **s) {
         struct kdbus_cmd *make;
         struct kdbus_item *n;
 int bus_kernel_create_bus(const char *name, bool world, char **s) {
         struct kdbus_cmd *make;
         struct kdbus_item *n;
@@ -1631,6 +1633,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
 
         return fd;
 }
 
         return fd;
 }
+#endif // 0
 
 int bus_kernel_open_bus_fd(const char *bus, char **path) {
         char *p;
 
 int bus_kernel_open_bus_fd(const char *bus, char **path) {
         char *p;
@@ -1664,6 +1667,8 @@ int bus_kernel_open_bus_fd(const char *bus, char **path) {
         return fd;
 }
 
         return fd;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **ep_path) {
         _cleanup_free_ char *path = NULL;
         struct kdbus_cmd *make;
 int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **ep_path) {
         _cleanup_free_ char *path = NULL;
         struct kdbus_cmd *make;
@@ -1707,6 +1712,7 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char *
 
         return fd;
 }
 
         return fd;
 }
+#endif // 0
 
 int bus_kernel_try_close(sd_bus *bus) {
         struct kdbus_cmd byebye = { .size = sizeof(byebye) };
 
 int bus_kernel_try_close(sd_bus *bus) {
         struct kdbus_cmd byebye = { .size = sizeof(byebye) };
@@ -1720,6 +1726,8 @@ int bus_kernel_try_close(sd_bus *bus) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_kernel_drop_one(int fd) {
         struct kdbus_cmd_recv recv = {
                 .size = sizeof(recv),
 int bus_kernel_drop_one(int fd) {
         struct kdbus_cmd_recv recv = {
                 .size = sizeof(recv),
@@ -1733,6 +1741,7 @@ int bus_kernel_drop_one(int fd) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 int bus_kernel_realize_attach_flags(sd_bus *bus) {
         struct kdbus_cmd *update;
 
 int bus_kernel_realize_attach_flags(sd_bus *bus) {
         struct kdbus_cmd *update;
index bb4dff6d8262a00407ce88cb92efc415ce862371..7086f93190bdc021e0ad1d9f190c24695c817403 100644 (file)
@@ -71,8 +71,8 @@ int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority);
 
 int bus_kernel_open_bus_fd(const char *bus, char **path);
 
 
 int bus_kernel_open_bus_fd(const char *bus, char **path);
 
-int bus_kernel_create_bus(const char *name, bool world, char **s);
-int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path);
+// UNNEEDED int bus_kernel_create_bus(const char *name, bool world, char **s);
+// UNNEEDED int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path);
 
 int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated);
 void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated);
 
 int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated);
 void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated);
@@ -86,7 +86,7 @@ uint64_t attach_flags_to_kdbus(uint64_t sd_bus_flags);
 
 int bus_kernel_try_close(sd_bus *bus);
 
 
 int bus_kernel_try_close(sd_bus *bus);
 
-int bus_kernel_drop_one(int fd);
+// UNNEEDED int bus_kernel_drop_one(int fd);
 
 int bus_kernel_realize_attach_flags(sd_bus *bus);
 
 
 int bus_kernel_realize_attach_flags(sd_bus *bus);
 
diff --git a/src/shared/apparmor-util.c b/src/shared/apparmor-util.c
deleted file mode 100644 (file)
index c2bbd33..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2013 Lennart Poettering
-
-  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 <http://www.gnu.org/licenses/>.
-***/
-
-
-#include "util.h"
-#include "fileio.h"
-#include "apparmor-util.h"
-
-bool mac_apparmor_use(void) {
-        static int cached_use = -1;
-
-        if (cached_use < 0) {
-                _cleanup_free_ char *p = NULL;
-
-                cached_use =
-                        read_one_line_file("/sys/module/apparmor/parameters/enabled", &p) >= 0 &&
-                        parse_boolean(p) > 0;
-        }
-
-        return cached_use;
-}
index 3674105ccc179a0a68c107c056bc8445f9c5a97a..9297b9f6bda3e4ce2ae9b9e1a8d0f00c67641612 100644 (file)
@@ -93,6 +93,8 @@ int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name) {
         return 0;
 }
 
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_event_loop_with_idle(
                 sd_event *e,
                 sd_bus *bus,
 int bus_event_loop_with_idle(
                 sd_event *e,
                 sd_bus *bus,
@@ -165,6 +167,7 @@ int bus_event_loop_with_idle(
 
         return code;
 }
 
         return code;
 }
+#endif // 0
 
 int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error) {
         _cleanup_bus_message_unref_ sd_bus_message *rep = NULL;
 
 int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error) {
         _cleanup_bus_message_unref_ sd_bus_message *rep = NULL;
@@ -1100,6 +1103,8 @@ int bus_message_map_all_properties(
         return sd_bus_message_exit_container(m);
 }
 
         return sd_bus_message_exit_container(m);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_message_map_properties_changed(
                 sd_bus_message *m,
                 const struct bus_properties_map *map,
 int bus_message_map_properties_changed(
                 sd_bus_message *m,
                 const struct bus_properties_map *map,
@@ -1135,6 +1140,7 @@ int bus_message_map_properties_changed(
 
         return invalidated;
 }
 
         return invalidated;
 }
+#endif // 0
 
 int bus_map_all_properties(
                 sd_bus *bus,
 
 int bus_map_all_properties(
                 sd_bus *bus,
@@ -1202,6 +1208,8 @@ int bus_open_transport(BusTransport transport, const char *host, bool user, sd_b
         return r;
 }
 
         return r;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_open_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus) {
         int r;
 
 int bus_open_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus) {
         int r;
 
@@ -1236,6 +1244,7 @@ int bus_open_transport_systemd(BusTransport transport, const char *host, bool us
 
         return r;
 }
 
         return r;
 }
+#endif // 0
 
 int bus_property_get_bool(
                 sd_bus *bus,
 
 int bus_property_get_bool(
                 sd_bus *bus,
@@ -1305,6 +1314,8 @@ int bus_log_create_error(int r) {
         return log_error_errno(r, "Failed to create bus message: %m");
 }
 
         return log_error_errno(r, "Failed to create bus message: %m");
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
         assert(message);
         assert(u);
 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
         assert(message);
         assert(u);
@@ -1564,6 +1575,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 typedef struct BusWaitForJobs {
         sd_bus *bus;
 
 typedef struct BusWaitForJobs {
         sd_bus *bus;
@@ -1576,6 +1588,8 @@ typedef struct BusWaitForJobs {
         sd_bus_slot *slot_disconnected;
 } BusWaitForJobs;
 
         sd_bus_slot *slot_disconnected;
 } BusWaitForJobs;
 
+/// UNNEEDED by elogind
+#if 0
 static int match_disconnected(sd_bus_message *m, void *userdata, sd_bus_error *error) {
         assert(m);
 
 static int match_disconnected(sd_bus_message *m, void *userdata, sd_bus_error *error) {
         assert(m);
 
@@ -1615,6 +1629,7 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *er
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 void bus_wait_for_jobs_free(BusWaitForJobs *d) {
         if (!d)
 
 void bus_wait_for_jobs_free(BusWaitForJobs *d) {
         if (!d)
@@ -1633,6 +1648,8 @@ void bus_wait_for_jobs_free(BusWaitForJobs *d) {
         free(d);
 }
 
         free(d);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
         _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *d = NULL;
         int r;
 int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
         _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *d = NULL;
         int r;
@@ -1682,6 +1699,7 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
 
         return 0;
 }
 
         return 0;
 }
+#endif // 0
 
 static int bus_process_wait(sd_bus *bus) {
         int r;
 
 static int bus_process_wait(sd_bus *bus) {
         int r;
index 3b6374ae74386d0b308a72a92bc4fa369dc34723..d6277e213a0226e6317893db0de6545d8b94ac38 100644 (file)
@@ -47,14 +47,14 @@ struct bus_properties_map {
 int bus_map_id128(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
 
 int bus_message_map_all_properties(sd_bus_message *m, const struct bus_properties_map *map,  void *userdata);
 int bus_map_id128(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
 
 int bus_message_map_all_properties(sd_bus_message *m, const struct bus_properties_map *map,  void *userdata);
-int bus_message_map_properties_changed(sd_bus_message *m, const struct bus_properties_map *map, void *userdata);
+// UNNEEDED int bus_message_map_properties_changed(sd_bus_message *m, const struct bus_properties_map *map, void *userdata);
 int bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map, void *userdata);
 
 int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name);
 
 typedef bool (*check_idle_t)(void *userdata);
 
 int bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map, void *userdata);
 
 int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name);
 
 typedef bool (*check_idle_t)(void *userdata);
 
-int bus_event_loop_with_idle(sd_event *e, sd_bus *bus, const char *name, usec_t timeout, check_idle_t check_idle, void *userdata);
+// UNNEEDED int bus_event_loop_with_idle(sd_event *e, sd_bus *bus, const char *name, usec_t timeout, check_idle_t check_idle, void *userdata);
 
 int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error);
 
 
 int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error);
 
@@ -69,7 +69,7 @@ int bus_open_system_systemd(sd_bus **_bus);
 int bus_open_user_systemd(sd_bus **_bus);
 
 int bus_open_transport(BusTransport transport, const char *host, bool user, sd_bus **bus);
 int bus_open_user_systemd(sd_bus **_bus);
 
 int bus_open_transport(BusTransport transport, const char *host, bool user, sd_bus **bus);
-int bus_open_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus);
+// UNNEEDED int bus_open_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus);
 
 int bus_print_property(const char *name, sd_bus_message *property, bool all);
 int bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, char **filter, bool all);
 
 int bus_print_property(const char *name, sd_bus_message *property, bool all);
 int bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, char **filter, bool all);
@@ -133,7 +133,7 @@ typedef struct UnitInfo {
         const char *job_path;
 } UnitInfo;
 
         const char *job_path;
 } UnitInfo;
 
-int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u);
+// UNNEEDED int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_flush_close_unref);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_flush_close_unref);
@@ -181,14 +181,15 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_track*, sd_bus_track_unref);
         SD_BUS_PROPERTY(name, "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, realtime), (flags)), \
         SD_BUS_PROPERTY(name "Monotonic", "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, monotonic), (flags))
 
         SD_BUS_PROPERTY(name, "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, realtime), (flags)), \
         SD_BUS_PROPERTY(name "Monotonic", "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, monotonic), (flags))
 
-int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment);
+// UNNEEDED int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment);
 
 typedef struct BusWaitForJobs BusWaitForJobs;
 
 
 typedef struct BusWaitForJobs BusWaitForJobs;
 
-int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret);
+// UNNEEDED int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret);
 void bus_wait_for_jobs_free(BusWaitForJobs *d);
 int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path);
 int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet);
 void bus_wait_for_jobs_free(BusWaitForJobs *d);
 int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path);
 int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet);
+// UNNEEDED int bus_wait_for_jobs_one(BusWaitForJobs *d, const char *path, bool quiet);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free);
 
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free);
 
diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c
deleted file mode 100644 (file)
index 46cecc8..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2014 Lennart Poettering
-
-  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 <http://www.gnu.org/licenses/>.
-***/
-
-#include <seccomp.h>
-
-#include "util.h"
-#include "seccomp-util.h"
-
-const char* seccomp_arch_to_string(uint32_t c) {
-
-        if (c == SCMP_ARCH_NATIVE)
-                return "native";
-        if (c == SCMP_ARCH_X86)
-                return "x86";
-        if (c == SCMP_ARCH_X86_64)
-                return "x86-64";
-        if (c == SCMP_ARCH_X32)
-                return "x32";
-        if (c == SCMP_ARCH_ARM)
-                return "arm";
-
-        return NULL;
-}
-
-/// UNNEEDED by elogind
-#if 0
-int seccomp_arch_from_string(const char *n, uint32_t *ret) {
-        if (!n)
-                return -EINVAL;
-
-        assert(ret);
-
-        if (streq(n, "native"))
-                *ret = SCMP_ARCH_NATIVE;
-        else if (streq(n, "x86"))
-                *ret = SCMP_ARCH_X86;
-        else if (streq(n, "x86-64"))
-                *ret = SCMP_ARCH_X86_64;
-        else if (streq(n, "x32"))
-                *ret = SCMP_ARCH_X32;
-        else if (streq(n, "arm"))
-                *ret = SCMP_ARCH_ARM;
-        else
-                return -EINVAL;
-
-        return 0;
-}
-#endif // 0
-
-int seccomp_add_secondary_archs(scmp_filter_ctx *c) {
-
-#if defined(__i386__) || defined(__x86_64__)
-        int r;
-
-        /* Add in all possible secondary archs we are aware of that
-         * this kernel might support. */
-
-        r = seccomp_arch_add(c, SCMP_ARCH_X86);
-        if (r < 0 && r != -EEXIST)
-                return r;
-
-        r = seccomp_arch_add(c, SCMP_ARCH_X86_64);
-        if (r < 0 && r != -EEXIST)
-                return r;
-
-        r = seccomp_arch_add(c, SCMP_ARCH_X32);
-        if (r < 0 && r != -EEXIST)
-                return r;
-
-#endif
-
-        return 0;
-
-}
diff --git a/src/shared/seccomp-util.h b/src/shared/seccomp-util.h
deleted file mode 100644 (file)
index b59f3fc..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#pragma once
-
-/***
-  This file is part of systemd.
-
-  Copyright 2014 Lennart Poettering
-
-  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 <http://www.gnu.org/licenses/>.
-***/
-
-#include <seccomp.h>
-
-const char* seccomp_arch_to_string(uint32_t c);
-// UNNEEDED int seccomp_arch_from_string(const char *n, uint32_t *ret);
-
-int seccomp_add_secondary_archs(scmp_filter_ctx *c);