chiark / gitweb /
Prep v238: Uncomment now needed headers and unmask now needed functions in src/basic...
authorSven Eden <yamakuzure@gmx.net>
Tue, 5 Jun 2018 17:08:31 +0000 (19:08 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 5 Jun 2018 17:08:54 +0000 (19:08 +0200)
30 files changed:
src/basic/build.h
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/basic/env-util.c
src/basic/env-util.h
src/basic/errno-list.c
src/basic/errno-list.h
src/basic/fd-util.c
src/basic/fd-util.h
src/basic/fs-util.h
src/basic/hash-funcs.c
src/basic/log.c
src/basic/mkdir-label.c
src/basic/mount-util.c
src/basic/mount-util.h
src/basic/parse-util.c
src/basic/process-util.c
src/basic/process-util.h
src/basic/procfs-util.c
src/basic/procfs-util.h
src/basic/random-util.c
src/basic/rm-rf.h
src/basic/socket-util.c
src/basic/socket-util.h
src/basic/terminal-util.c
src/basic/terminal-util.h
src/basic/unit-name.c
src/basic/util.c
src/basic/util.h
src/basic/verbs.c

index cbc638c8cb1b946f805e6ef7be7f3c8edde7cefa..88c45e1bc9bbd6fab211c441fae989968df92a16 100644 (file)
 #else
 #define _PCRE2_FEATURE_ "-PCRE2"
 #endif
-#else
-#define _IDN_FEATURE_ "-IDN"
-#endif
 #endif // 0
 
 #define _CGROUP_HIEARCHY_ "default-hierarchy=" DEFAULT_HIERARCHY_NAME
index 302fc95ddcfaca7776cf4430d96ad95160770372..6364a930ac918747c0a9120e269effe514f3f88e 100644 (file)
@@ -1469,7 +1469,6 @@ int cg_pid_get_path_shifted(pid_t pid, const char *root, char **cgroup) {
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int cg_path_decode_unit(const char *cgroup, char **unit) {
         char *c, *s;
         size_t n;
@@ -1572,6 +1571,7 @@ int cg_pid_get_unit(pid_t pid, char **unit) {
         return cg_path_get_unit(cgroup, unit);
 }
 
+#if 0 /// UNNEEDED by elogind
 /**
  * Skip session-*.scope, but require it to be there.
  */
index 148d298de66dc2ce98d55fd58a697fc5a8fba43f..b6f427bda3b15b0981ac68e1a6b35ca69664fbd5 100644 (file)
 #include "set.h"
 
 #if 0 /// elogind has them set through config.h
-#define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=elogind"
+#define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=systemd"
 #define SYSTEMD_CGROUP_CONTROLLER_HYBRID "name=unified"
+#define SYSTEMD_CGROUP_CONTROLLER "_systemd"
 #endif // 0
-#define SYSTEMD_CGROUP_CONTROLLER "_elogind"
 
 /* An enum of well known cgroup controllers */
 typedef enum CGroupController {
@@ -213,8 +213,8 @@ int cg_get_root_path(char **path);
 
 int cg_path_get_session(const char *path, char **session);
 int cg_path_get_owner_uid(const char *path, uid_t *uid);
-#if 0 /// UNNEEDED by elogind
 int cg_path_get_unit(const char *path, char **unit);
+#if 0 /// UNNEEDED by elogind
 int cg_path_get_user_unit(const char *path, char **unit);
 int cg_path_get_machine_name(const char *path, char **machine);
 #endif // 0
@@ -226,17 +226,15 @@ int cg_pid_get_path_shifted(pid_t pid, const char *cached_root, char **cgroup);
 
 int cg_pid_get_session(pid_t pid, char **session);
 int cg_pid_get_owner_uid(pid_t pid, uid_t *uid);
-#if 0 /// UNNEEDED by elogind
 int cg_pid_get_unit(pid_t pid, char **unit);
+#if 0 /// UNNEEDED by elogind
 int cg_pid_get_user_unit(pid_t pid, char **unit);
 int cg_pid_get_machine_name(pid_t pid, char **machine);
 #endif // 0
 int cg_pid_get_slice(pid_t pid, char **slice);
 int cg_pid_get_user_slice(pid_t pid, char **slice);
 
-#if 0 /// UNNEEDED by elogind
 int cg_path_decode_unit(const char *cgroup, char **unit);
-#endif // 0
 
 char *cg_escape(const char *p);
 char *cg_unescape(const char *p) _pure_;
index 34f821d573ec640e769410660e281dcf34228af0..dd93023b5ae0eb05c47bac0cfe543634e1eebc6d 100644 (file)
@@ -752,6 +752,7 @@ char **replace_env_argv(char **argv, char **env) {
         ret[k] = NULL;
         return ret;
 }
+#endif // 0
 
 int getenv_bool(const char *p) {
         const char *e;
@@ -763,6 +764,7 @@ int getenv_bool(const char *p) {
         return parse_boolean(e);
 }
 
+#if 0 /// UNNEEDED by elogind
 int getenv_bool_secure(const char *p) {
         const char *e;
 
index ca548e1335aaa9eafe39bb3d2d3f4113382db855..056878f9a2f0ee1414189b746093a11a007a5d5e 100644 (file)
@@ -61,8 +61,10 @@ int strv_env_replace(char ***l, char *p); /* In place ... */
 
 char *strv_env_get_n(char **l, const char *name, size_t k, unsigned flags) _pure_;
 char *strv_env_get(char **x, const char *n) _pure_;
+#endif // 0
 
 int getenv_bool(const char *p);
+#if 0 /// UNNEEDED by elogind
 int getenv_bool_secure(const char *p);
 
 int serialize_environment(FILE *f, char **environment);
index 256eec0867d5ce75ed7a65b5ca9145fa6407a5d1..b72dce3cf843dca34577e4e58b449d7216237f7e 100644 (file)
@@ -18,7 +18,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-//#include <errno.h>
+#include <errno.h>
 #include <string.h>
 
 #include "errno-list.h"
index 0f87161605e409317bd39473f54e141a38e570fb..38beaf96dd80f7ebfe7d626d0054a9a34f40833a 100644 (file)
@@ -20,7 +20,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-//#include <stdbool.h>
+#include <stdbool.h>
 /*
  * MAX_ERRNO is defined as 4095 in linux/err.h
  * We use the same value here.
@@ -29,8 +29,6 @@
 
 const char *errno_to_name(int id);
 int errno_from_name(const char *name);
-#if 0 /// UNNEEDED by elogind
-#endif // 0
 static inline bool errno_is_valid(int n) {
         return n > 0 && n <= ERRNO_MAX;
 }
index c67d4243a30dc858538205189ec9e426087facaf..1196b4df987575c740a5de5c98e6cfe0494e428d 100644 (file)
@@ -362,6 +362,7 @@ bool fdname_is_valid(const char *s) {
 
         return p - s < 256;
 }
+#endif // 0
 
 int fd_get_path(int fd, char **ret) {
         char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
@@ -376,7 +377,6 @@ int fd_get_path(int fd, char **ret) {
 
         return r;
 }
-#endif // 0
 
 int move_fd(int from, int to, int cloexec) {
         int r;
index 56fae8a47338c7694bf4626761d48a8672a5a1db..838dd5937322c4d7b2b34874e85f66285e5951c1 100644 (file)
@@ -82,9 +82,9 @@ int same_fd(int a, int b);
 void cmsg_close_all(struct msghdr *mh);
 
 bool fdname_is_valid(const char *s);
+#endif // 0
 
 int fd_get_path(int fd, char **ret);
-#endif // 0
 
 int move_fd(int from, int to, int cloexec);
 
index 0737e403ed62749f8a47abd6f179e1a3422b155c..c089cc55596652e6b5e1ddf3dd1e0a47bef397f2 100644 (file)
@@ -29,7 +29,7 @@
 #include <unistd.h>
 
 #include "time-util.h"
-//#include "util.h"
+#include "util.h"
 
 int unlink_noerrno(const char *path);
 
@@ -76,9 +76,11 @@ int get_files_in_directory(const char *path, char ***list);
 int tmp_dir(const char **ret);
 #if 0 /// UNNEEDED by elogind
 int var_tmp_dir(const char **ret);
+#endif // 0
 
 int unlink_or_warn(const char *filename);
 
+#if 0 /// UNNEEDED by elogind
 #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
 
 #define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
index 763c1f61dcd14d89cd6708375836ad6d0b701a6c..947bcfd584331cb64f7cbcb5d853ec58bdb89219 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-//#include <string.h>
+#include <string.h>
 
 #include "hash-funcs.h"
-//#include "path-util.h"
+#include "path-util.h"
 
 void string_hash_func(const void *p, struct siphash *state) {
         siphash24_compress(p, strlen(p) + 1, state);
index 84c92d1c77251ab41a295220dfc95aa154ea6e32..1ec3faea823de66fc367ed0c666461a480015b90 100644 (file)
@@ -54,7 +54,7 @@
 #include "syslog-util.h"
 #include "terminal-util.h"
 #include "time-util.h"
-//#include "utf8.h"
+#include "utf8.h"
 #include "util.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
index 59ba85b85dc7c0ead1972828180dba952c7f4157..3fa642578b994c36a455fb405189e369e6f9838f 100644 (file)
 ***/
 
 #include <stdio.h>
-//#include <sys/stat.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 #include "label.h"
-//#include "macro.h"
+#include "macro.h"
 #include "mkdir.h"
-//#include "selinux-util.h"
-//#include "smack-util.h"
+#include "selinux-util.h"
+#include "smack-util.h"
 
 int mkdir_label(const char *path, mode_t mode) {
         int r;
index 4c9b5adff4e2617abe6721c25f80da2c4edf50e9..db90194ffa3b9727cb3e71ff2de4aead82d72a0f 100644 (file)
@@ -891,6 +891,7 @@ int mount_propagation_flags_from_string(const char *name, unsigned long *ret) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int mount_option_mangle(
                 const char *options,
                 unsigned long mount_flags,
@@ -960,3 +961,4 @@ int mount_option_mangle(
 
         return 0;
 }
+#endif // 0
index 5088dad930031f7b62a9eedd2f0bcd0857be0172..c213e5788287ef234acd35dd256974af24a5ef90 100644 (file)
@@ -74,8 +74,10 @@ int umount_verbose(const char *where);
 const char *mount_propagation_flags_to_string(unsigned long flags);
 int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
 
+#if 0 /// UNNEEDED by elogind
 int mount_option_mangle(
                 const char *options,
                 unsigned long mount_flags,
                 unsigned long *ret_mount_flags,
                 char **ret_remaining_options);
+#endif // 0
index c8bca5a3087781c84dbef5373432948ff19698ee..4c262538927e1eed714f6a790c632fbba83c92f8 100644 (file)
@@ -28,7 +28,7 @@
 #include "alloc-util.h"
 #include "errno-list.h"
 //#include "extract-word.h"
-//#include "locale-util.h"
+#include "locale-util.h"
 #include "macro.h"
 #include "parse-util.h"
 #include "process-util.h"
index 1ebfb0c7297c7186a01b39bdb4847423bd2001e0..d3961bfd2dc377fbb170a801a7e5c571b1d30698 100644 (file)
@@ -26,7 +26,7 @@
 #include <signal.h>
 #include <stdbool.h>
 #include <stdio.h>
-//#include <stdio_ext.h>
+#include <stdio_ext.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/mman.h>
@@ -51,7 +51,7 @@
 #include "macro.h"
 #include "missing.h"
 #include "process-util.h"
-//#include "raw-clone.h"
+#include "raw-clone.h"
 #include "signal-util.h"
 //#include "stat-util.h"
 #include "string-table.h"
@@ -280,7 +280,6 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int rename_process(const char name[]) {
         static size_t mm_size = 0;
         static char *mm = NULL;
@@ -397,7 +396,6 @@ use_saved_argv:
 
         return !truncated;
 }
-#endif // 0
 
 int is_kernel_thread(pid_t pid) {
         _cleanup_free_ char *line = NULL;
@@ -836,6 +834,7 @@ void sigkill_waitp(pid_t *pid) {
 
         sigkill_wait(*pid);
 }
+#endif // 0
 
 void sigterm_wait(pid_t pid) {
         assert(pid > 1);
@@ -856,7 +855,6 @@ int kill_and_sigcont(pid_t pid, int sig) {
 
         return r;
 }
-#endif // 0
 
 int getenv_for_pid(pid_t pid, const char *field, char **ret) {
         _cleanup_fclose_ FILE *f = NULL;
index 82b1de03c8c8a54b853d8002e1f4f67c4b9f0151..50074feb2d5df654a1eb4374e88ccb053383369c 100644 (file)
@@ -21,7 +21,7 @@
 ***/
 
 #include <alloca.h>
-//#include <errno.h>
+#include <errno.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
@@ -34,7 +34,7 @@
 #include "format-util.h"
 //#include "ioprio.h"
 #include "macro.h"
-//#include "time-util.h"
+#include "time-util.h"
 
 #define procfs_file_alloca(pid, field)                                  \
         ({                                                              \
@@ -79,12 +79,12 @@ int wait_for_terminate_with_timeout(pid_t pid, usec_t timeout);
 
 void sigkill_wait(pid_t pid);
 void sigkill_waitp(pid_t *pid);
+#endif // 0
 void sigterm_wait(pid_t pid);
 
 int kill_and_sigcont(pid_t pid, int sig);
 
 int rename_process(const char name[]);
-#endif // 0
 int is_kernel_thread(pid_t pid);
 
 int getenv_for_pid(pid_t pid, const char *field, char **_value);
@@ -122,8 +122,10 @@ int ioprio_class_from_string(const char *s);
 
 const char *sigchld_code_to_string(int i) _const_;
 int sigchld_code_from_string(const char *s) _pure_;
+#endif // 0
 
 int sched_policy_to_string_alloc(int i, char **s);
+#if 0 /// UNNEEDED by elogind
 int sched_policy_from_string(const char *s);
 #endif // 0
 
@@ -143,11 +145,13 @@ int pid_compare_func(const void *a, const void *b);
 static inline bool nice_is_valid(int n) {
         return n >= PRIO_MIN && n < PRIO_MAX;
 }
+#endif // 0
 
 static inline bool sched_policy_is_valid(int i) {
         return IN_SET(i, SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR);
 }
 
+#if 0 /// UNNEEDED by elogind
 static inline bool sched_priority_is_valid(int i) {
         return i >= 0 && i <= sched_get_priority_max(SCHED_RR);
 }
index 7b1dfdf6e4a6e90a9343a9028bcb21012067fe87..f821d64d58be8ed88806d442d54cfe2ceefd8ff0 100644 (file)
@@ -1,16 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-//#include <errno.h>
-
-//#include "alloc-util.h"
-//#include "def.h"
-//#include "fd-util.h"
-//#include "fileio.h"
-//#include "parse-util.h"
-//#include "process-util.h"
-//#include "procfs-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
+#include <errno.h>
+
+#include "alloc-util.h"
+#include "def.h"
+#include "fd-util.h"
+#include "fileio.h"
+#include "parse-util.h"
+#include "process-util.h"
+#include "procfs-util.h"
+#include "stdio-util.h"
+#include "string-util.h"
 
 int procfs_tasks_get_limit(uint64_t *ret) {
         _cleanup_free_ char *value = NULL;
@@ -57,6 +57,7 @@ int procfs_tasks_get_limit(uint64_t *ret) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int procfs_tasks_set_limit(uint64_t limit) {
         char buffer[DECIMAL_STR_MAX(uint64_t)+1];
         _cleanup_free_ char *value = NULL;
@@ -265,3 +266,4 @@ int procfs_memory_get_current(uint64_t *ret) {
         *ret = (mem_total - mem_free) * 1024U;
         return 0;
 }
+#endif // 0
index 757e79c0d7ccf576fff995b945f58b33a18cc420..0d1c7d2315e6df67805612818067f97f034304c9 100644 (file)
@@ -1,14 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
-//#include <inttypes.h>
+#include <inttypes.h>
 
-//#include "time-util.h"
+#include "time-util.h"
 
 int procfs_tasks_get_limit(uint64_t *ret);
+#if 0 /// UNNEEDED by elogind
 int procfs_tasks_set_limit(uint64_t limit);
 int procfs_tasks_get_current(uint64_t *ret);
 
 int procfs_cpu_get_usage(nsec_t *ret);
 
 int procfs_memory_get_current(uint64_t *ret);
+#endif // 0
index 127c4522b8839eb15a116c178a1a842f53cb04cf..13b033ff8bb3952aa517e49374c25b5c613fe8a7 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdbool.h>
 //#include <stdint.h>
 #include <stdlib.h>
-//#include <string.h>
+#include <string.h>
 #include <sys/time.h>
 
 #if HAVE_SYS_AUXV_H
index 27d8cc1e55a8f390184db5f250a276e43923ebe3..6e63d3feab508ef1fb18fe5ba8536a32d1201f9e 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <sys/stat.h>
 
-//#include "util.h"
+#include "util.h"
 
 typedef enum RemoveFlags {
         REMOVE_ONLY_DIRECTORIES = 1 << 0,
index 7e68a672e60bb88326aa9dcf2bf5269b1c255a18..0564a68125ee3d6f319cd7c4561b8b11bf51cd2a 100644 (file)
@@ -41,7 +41,7 @@
 #include "missing.h"
 #include "parse-util.h"
 #include "path-util.h"
-//#include "process-util.h"
+#include "process-util.h"
 #include "socket-util.h"
 #include "string-table.h"
 #include "string-util.h"
@@ -555,8 +555,8 @@ bool socket_address_matches_fd(const SocketAddress *a, int fd) {
 
         return socket_address_equal(a, &b);
 }
+#endif // 0
 
-int sockaddr_port(const struct sockaddr *_sa, unsigned *port) {
 int sockaddr_port(const struct sockaddr *_sa, unsigned *ret_port) {
         union sockaddr_union *sa = (union sockaddr_union*) _sa;
 
@@ -567,17 +567,14 @@ int sockaddr_port(const struct sockaddr *_sa, unsigned *ret_port) {
         switch (sa->sa.sa_family) {
 
         case AF_INET:
-                *port = be16toh(sa->in.sin_port);
                 *ret_port = be16toh(sa->in.sin_port);
                 return 0;
 
         case AF_INET6:
-                *port = be16toh(sa->in6.sin6_port);
                 *ret_port = be16toh(sa->in6.sin6_port);
                 return 0;
 
         case AF_VSOCK:
-                *port = sa->vm.svm_port;
                 *ret_port = sa->vm.svm_port;
                 return 0;
 
@@ -586,6 +583,7 @@ int sockaddr_port(const struct sockaddr *_sa, unsigned *ret_port) {
         }
 }
 
+#if 0 /// UNNEEDED by elogind
 int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret) {
         union sockaddr_union *sa = (union sockaddr_union*) _sa;
         char *p;
index 94acc6f2cef9c0a4bea063e4c3014803b59c8493..75218755b04bef399d3ba52f67f0a4fd79333cf5 100644 (file)
@@ -46,11 +46,11 @@ union sockaddr_union {
         struct sockaddr_in in;
         struct sockaddr_in6 in6;
         struct sockaddr_un un;
-#if 0 /// UNNEEDED by elogind, only 'sa', 'in', 'in6' and 'un' are used in all of elogind.
+#if 0 /// UNNEEDED by elogind.
         struct sockaddr_nl nl;
         struct sockaddr_ll ll;
-        struct sockaddr_vm vm;
 #endif // 0
+        struct sockaddr_vm vm;
 
         /* Ensure there is enough space to store Infiniband addresses */
         uint8_t ll_buffer[offsetof(struct sockaddr_ll, sll_addr) + CONST_MAX(ETH_ALEN, INFINIBAND_ALEN)];
@@ -121,9 +121,11 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_
 const char* socket_address_get_path(const SocketAddress *a);
 
 bool socket_ipv6_is_supported(void);
+#endif // 0
 
 int sockaddr_port(const struct sockaddr *_sa, unsigned *port);
 
+#if 0 /// UNNEEDED by elogind
 int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
 int getpeername_pretty(int fd, bool include_port, char **ret);
 int getsockname_pretty(int fd, char **ret);
index ccebe805d3676482d43844df077380b795d47261..d1d88ab93aa82471a812581cefab2058ce13dd95 100644 (file)
@@ -1245,6 +1245,7 @@ bool colors_enabled(void) {
         return cached_colors_enabled;
 }
 
+#if 0 /// UNNEEDED by elogind
 bool dev_console_colors_enabled(void) {
         _cleanup_free_ char *s = NULL;
         int b;
@@ -1265,6 +1266,7 @@ bool dev_console_colors_enabled(void) {
 
         return !streq_ptr(s, "dumb");
 }
+#endif // 0
 
 bool underline_enabled(void) {
 
index 667424c0a81a4930783968db12e3f88c3ffdd631..5aa0fc32fb69e2ce1ab2190dd5ff6339fa922a26 100644 (file)
@@ -142,7 +142,9 @@ bool on_tty(void);
 bool terminal_is_dumb(void);
 bool colors_enabled(void);
 bool underline_enabled(void);
+#if 0 /// UNNEEDED by elogind
 bool dev_console_colors_enabled(void);
+#endif // 0
 
 #define DEFINE_ANSI_FUNC(name, NAME)                            \
         static inline const char *ansi_##name(void) {           \
index 90d17a0d8bf76b150d680bda4e830f27e37b5dfb..d42d59bd189003e951649d5b8d85c45167339438 100644 (file)
@@ -28,7 +28,7 @@
 //#include "glob-util.h"
 #include "hexdecoct.h"
 #include "path-util.h"
-//#include "special.h"
+#include "special.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index 5133d9b1ec134c40957fd2dfb2fefee080958325..e096e3194cdceea88848e583e2f53c49317d3ca7 100644 (file)
@@ -52,7 +52,7 @@
 #include "parse-util.h"
 //#include "path-util.h"
 #include "process-util.h"
-//#include "procfs-util.h"
+#include "procfs-util.h"
 #include "set.h"
 #include "signal-util.h"
 #include "stat-util.h"
@@ -174,11 +174,11 @@ bool in_initrd(void) {
         return saved_in_initrd;
 }
 
+#if 0 /// UNNEEDED by elogind
 void in_initrd_force(bool value) {
         saved_in_initrd = value;
 }
 
-#if 0 /// UNNEEDED by elogind
 /* hey glibc, APIs with callbacks without a user pointer are so useless */
 void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
                  int (*compar) (const void *, const void *, void *), void *arg) {
@@ -201,6 +201,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
         }
         return NULL;
 }
+#endif // 0
 
 int on_ac_power(void) {
         bool found_offline = false, found_online = false;
@@ -267,7 +268,6 @@ int on_ac_power(void) {
         return found_online || !found_offline;
 }
 
-#endif // 0
 int container_get_leader(const char *machine, pid_t *pid) {
         _cleanup_free_ char *s = NULL, *class = NULL;
         const char *p;
@@ -480,7 +480,6 @@ uint64_t physical_memory_scale(uint64_t v, uint64_t max) {
 
 uint64_t system_tasks_max(void) {
 
-#else
         uint64_t a = TASKS_MAX, b = TASKS_MAX;
         _cleanup_free_ char *root = NULL;
 
@@ -525,8 +524,6 @@ uint64_t system_tasks_max_scale(uint64_t v, uint64_t max) {
         return m / max;
 }
 
-#if 0 /// UNNEEDED by elogind
-#endif // 0
 int version(void) {
         puts(PACKAGE_STRING "\n"
              SYSTEMD_FEATURES);
@@ -534,7 +531,6 @@ int version(void) {
 }
 
 #if 0 /// UNNEEDED by elogind
-#endif // 0
 /* This is a direct translation of str_verscmp from boot.c */
 static bool is_digit(int c) {
         return c >= '0' && c <= '9';
@@ -608,3 +604,4 @@ void disable_coredumps(void) {
         if (r < 0)
                 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
 }
+#endif // 0
index 2c2651e4805821de0be7a539a235cf130eba3848..c24fd6c63f43c7783154308838304d235650580d 100644 (file)
@@ -91,9 +91,9 @@ int prot_from_flags(int flags) _const_;
 #endif // 0
 
 bool in_initrd(void);
+#if 0 /// UNNEEDED by elogind
 void in_initrd_force(bool value);
 
-#if 0 /// UNNEEDED by elogind
 void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
                  int (*compar) (const void *, const void *, void *),
                  void *arg);
@@ -121,9 +121,7 @@ static inline void memcpy_safe(void *dst, const void *src, size_t n) {
         memcpy(dst, src, n);
 }
 
-#if 0 /// UNNEEDED by elogind
 int on_ac_power(void);
-#endif // 0
 
 #define memzero(x,l) (memset((x), 0, (l)))
 #define zero(x) (memzero(&(x), sizeof(x)))
@@ -196,12 +194,10 @@ uint64_t physical_memory_scale(uint64_t v, uint64_t max);
 uint64_t system_tasks_max(void);
 uint64_t system_tasks_max_scale(uint64_t v, uint64_t max);
 
-#if 0 /// UNNEEDED by elogind
-#endif // 0
 int version(void);
 
 #if 0 /// UNNEEDED by elogind
-#endif // 0
 int str_verscmp(const char *s1, const char *s2);
 
 void disable_coredumps(void);
+#endif // 0
index 0c87121c1606056d5af9e79e79789934e8fa8b92..caaa70aa58ffd947b308334961cd3d63104b937b 100644 (file)
 #include <stddef.h>
 //#include <string.h>
 
-//#include "env-util.h"
+#include "env-util.h"
 #include "log.h"
 #include "macro.h"
-//#include "process-util.h"
+#include "process-util.h"
 #include "string-util.h"
 #include "verbs.h"
 #include "virt.h"