chiark / gitweb /
Prep v228: Full diff to master revealed more functions that are unused.
authorSven Eden <yamakuzure@gmx.net>
Thu, 13 Apr 2017 05:44:02 +0000 (07:44 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 26 Apr 2017 10:59:13 +0000 (12:59 +0200)
src/basic/audit-util.c
src/basic/audit-util.h [new file with mode: 0644]
src/basic/cgroup-util.h
src/basic/fileio.c
src/basic/fileio.h
src/basic/path-util.c
src/basic/strv.c
src/basic/strv.h
src/basic/virt.c
src/basic/virt.h

index 4612297334156aa325b62894603120c30e45be50..d0a061abc06530d5eec679119d55402144aadbdc 100644 (file)
@@ -86,6 +86,7 @@ int audit_loginuid_from_pid(pid_t pid, uid_t *uid) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 bool use_audit(void) {
         static int cached_use = -1;
 
@@ -103,3 +104,4 @@ bool use_audit(void) {
 
         return cached_use;
 }
+#endif // 0
diff --git a/src/basic/audit-util.h b/src/basic/audit-util.h
new file mode 100644 (file)
index 0000000..8c4209d
--- /dev/null
@@ -0,0 +1,35 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 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 <stdint.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+#define AUDIT_SESSION_INVALID ((uint32_t) -1)
+
+int audit_session_from_pid(pid_t pid, uint32_t *id);
+int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
+
+#if 0 /// UNNEEDED by elogind
+bool use_audit(void);
+#endif // 0
index 3e7db8dbdb75d97ee4ca21d4a1ffd033c2db7cb3..307d41b62eba023d6e6b0799b24f3346c6b15049 100644 (file)
@@ -55,6 +55,7 @@ typedef enum CGroupMask {
         _CGROUP_MASK_ALL = CGROUP_CONTROLLER_TO_MASK(_CGROUP_CONTROLLER_MAX) - 1
 } CGroupMask;
 
+#if 0 /// UNNEEDED by elogind
 /* Special values for the cpu.shares attribute */
 #define CGROUP_CPU_SHARES_INVALID ((uint64_t) -1)
 #define CGROUP_CPU_SHARES_MIN UINT64_C(2)
@@ -78,6 +79,7 @@ static inline bool CGROUP_BLKIO_WEIGHT_IS_OK(uint64_t x) {
             x == CGROUP_BLKIO_WEIGHT_INVALID ||
             (x >= CGROUP_BLKIO_WEIGHT_MIN && x <= CGROUP_BLKIO_WEIGHT_MAX);
 }
+#endif // 0
 
 /*
  * General rules:
index cd2c361e3df600a15a40b383126f0c04c224e662..bfb75608f887d26926886398f091c71ea0e6f2ff 100644 (file)
@@ -935,6 +935,7 @@ DIR *xopendirat(int fd, const char *name, int flags) {
         return d;
 }
 
+#if 0 /// UNNEEDED by elogind
 static int search_and_fopen_internal(const char *path, const char *mode, const char *root, char **search, FILE **_f) {
         char **i;
 
@@ -995,7 +996,6 @@ int search_and_fopen(const char *path, const char *mode, const char *root, const
         return search_and_fopen_internal(path, mode, root, copy, _f);
 }
 
-#if 0 /// UNNEEDED by elogind
 int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f) {
         _cleanup_strv_free_ char **s = NULL;
 
@@ -1138,6 +1138,7 @@ int tempfn_xxxxxx(const char *p, const char *extra, char **ret) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int tempfn_random(const char *p, const char *extra, char **ret) {
         const char *fn;
         char *t, *x;
@@ -1180,7 +1181,6 @@ int tempfn_random(const char *p, const char *extra, char **ret) {
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int tempfn_random_child(const char *p, const char *extra, char **ret) {
         char *t, *x;
         uint64_t u;
index b2f1b0dc6aeab85397b61914e7988b6540d5ff8c..162c9dcd0ac9e4ef60018d432697a580c579cc6a 100644 (file)
@@ -58,8 +58,8 @@ int get_proc_field(const char *filename, const char *pattern, const char *termin
 
 DIR *xopendirat(int dirfd, const char *name, int flags);
 
-int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
 #if 0 /// UNNEEDED by elogind
+int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
 int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f);
 #endif // 0
 #define FOREACH_LINE(line, f, on_error)                         \
@@ -80,8 +80,8 @@ int open_tmpfile(const char *path, int flags);
 #endif // 0
 
 int tempfn_xxxxxx(const char *p, const char *extra, char **ret);
-int tempfn_random(const char *p, const char *extra, char **ret);
 #if 0 /// UNNEEDED by elogind
+int tempfn_random(const char *p, const char *extra, char **ret);
 int tempfn_random_child(const char *p, const char *extra, char **ret);
 
 int write_timestamp_file_atomic(const char *fn, usec_t n);
index 84ff2f387980006f9cc964089bcb24b5206e9873..b23b9c31262defce1463810222434ffdcbb1f6bb 100644 (file)
@@ -461,8 +461,6 @@ char* path_join(const char *root, const char *path, const char *rest) {
                                rest && rest[0] == '/' ? rest+1 : rest,
                                NULL);
 }
-#endif // 0
-#if 0 /// UNNEEDED by elogind
 
 int find_binary(const char *name, char **ret) {
         int last_error, r;
index 825fdcbdfe10474c9f2036c88b3da8ec6e7fdb72..8e509988963d2bfae0555a4f0f46623a99d9b7f8 100644 (file)
@@ -200,6 +200,7 @@ char **strv_new(const char *x, ...) {
         return r;
 }
 
+#if 0 /// UNNEEDED by elogind
 int strv_extend_strv(char ***a, char **b, bool filter_duplicates) {
         char **s, **t;
         size_t p, q, i = 0, j;
@@ -244,7 +245,6 @@ rollback:
         return -ENOMEM;
 }
 
-#if 0 /// UNNEEDED by elogind
 int strv_extend_strv_concat(char ***a, char **b, const char *suffix) {
         int r;
         char **s;
index 481829cac2f872b714fa372699850c4d63e82977..13ed1b371e69057dd8576a4fb5fe8db5b0c505ae 100644 (file)
@@ -45,8 +45,8 @@ void strv_clear(char **l);
 char **strv_copy(char * const *l);
 unsigned strv_length(char * const *l) _pure_;
 
-int strv_extend_strv(char ***a, char **b, bool filter_duplicates);
 #if 0 /// UNNEEDED by elogind
+int strv_extend_strv(char ***a, char **b, bool filter_duplicates);
 int strv_extend_strv_concat(char ***a, char **b, const char *suffix);
 #endif // 0
 int strv_extend(char ***l, const char *value);
index 7c0666cc244445a22d69e0229fd90c0ee75dce39..4b6286567899fc2376ba8a30d30a91f742ea7480 100644 (file)
@@ -34,6 +34,7 @@
 #include "util.h"
 #include "virt.h"
 
+#if 0 /// UNNEEDED by elogind
 static int detect_vm_cpuid(void) {
 
         /* CPUID is an x86 specific interface. */
@@ -320,6 +321,7 @@ finish:
         cached_found = r;
         return r;
 }
+#endif // 0
 
 int detect_container(void) {
 
@@ -431,6 +433,7 @@ int running_in_chroot(void) {
         return ret == 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 static const char *const virtualization_table[_VIRTUALIZATION_MAX] = {
         [VIRTUALIZATION_NONE] = "none",
         [VIRTUALIZATION_KVM] = "kvm",
@@ -455,3 +458,4 @@ static const char *const virtualization_table[_VIRTUALIZATION_MAX] = {
 };
 
 DEFINE_STRING_TABLE_LOOKUP(virtualization, int);
+#endif // 0
index feb47d50e37eef578addb8e43431c59296761d21..fc518dd4f02f3e3e471f54adff948a96188afe5c 100644 (file)
@@ -56,6 +56,7 @@ enum {
         _VIRTUALIZATION_INVALID = -1
 };
 
+#if 0 /// UNNEEDED by elogind
 static inline bool VIRTUALIZATION_IS_VM(int x) {
         return x >= VIRTUALIZATION_VM_FIRST && x <= VIRTUALIZATION_VM_LAST;
 }
@@ -65,6 +66,7 @@ static inline bool VIRTUALIZATION_IS_CONTAINER(int x) {
 }
 
 int detect_vm(void);
+#endif // 0
 int detect_container(void);
 #if 0 /// UNNEEDED by elogind
 int detect_virtualization(void);
@@ -72,5 +74,7 @@ int detect_virtualization(void);
 
 int running_in_chroot(void);
 
+#if 0 /// UNNEEDED by elogind
 const char *virtualization_to_string(int v) _const_;
 int virtualization_from_string(const char *s) _pure_;
+#endif // 0