chiark / gitweb /
Prep v233: Unmask now needed functions in src/basic
authorSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:13:52 +0000 (17:13 +0200)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:43 +0000 (17:58 +0200)
16 files changed:
src/basic/cgroup-util.h
src/basic/conf-files.c
src/basic/conf-files.h
src/basic/copy.h
src/basic/fileio.c
src/basic/fileio.h
src/basic/fs-util.c
src/basic/fs-util.h
src/basic/missing.h
src/basic/missing_syscall.h
src/basic/path-util.c
src/basic/proc-cmdline.c
src/basic/proc-cmdline.h
src/basic/string-util.h
src/basic/strv.c
src/basic/strv.h

index d8b6ef3dca4e838c38f6bfb3068de2ca33685ec3..ac115b4b75c06fcb2f610f4f432e9541f93c90ad 100644 (file)
@@ -253,12 +253,12 @@ int cg_kernel_controllers(Set *controllers);
 bool cg_ns_supported(void);
 #endif // 0
 
-#if 0 /// UNNEEDED by elogind
 int cg_all_unified(void);
 int cg_hybrid_unified(void);
 int cg_unified_controller(const char *controller);
 int cg_unified_flush(void);
 
+#if 0 /// UNNEEDED by elogind
 bool cg_is_unified_wanted(void);
 #endif // 0
 bool cg_is_legacy_wanted(void);
index 417bc5a5b0527d0eb476d36d68f7002f2eeaa854..1cd0d9dfc6967b32b544063bf9590216684a4855 100644 (file)
@@ -120,7 +120,6 @@ static int conf_files_list_strv_internal(char ***strv, const char *suffix, const
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int conf_files_list_strv(char ***strv, const char *suffix, const char *root, const char* const* dirs) {
         _cleanup_strv_free_ char **copy = NULL;
 
@@ -133,6 +132,7 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char *root, con
         return conf_files_list_strv_internal(strv, suffix, root, copy);
 }
 
+#if 0 /// UNNEEDED by elogind
 int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...) {
         _cleanup_strv_free_ char **dirs = NULL;
         va_list ap;
index e77fdd472f63bc77058fed435b64cf345169eaeb..3e684364c03adabdd159c303da1ad160ee5e4826 100644 (file)
@@ -22,6 +22,6 @@
 
 #if 0 /// UNNEEDED by elogind
 int conf_files_list(char ***ret, const char *suffix, const char *root, const char *dir, ...);
-int conf_files_list_strv(char ***ret, const char *suffix, const char *root, const char* const* dirs);
 #endif // 0
+int conf_files_list_strv(char ***ret, const char *suffix, const char *root, const char* const* dirs);
 int conf_files_list_nulstr(char ***ret, const char *suffix, const char *root, const char *dirs);
index d3aabf36adf25b88683920ce93ca96a59e769286..d46f1c92a731d385a2f1c6158fc4e01e6baf30d9 100644 (file)
 #include <stdint.h>
 #include <sys/types.h>
 
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
 typedef enum CopyFlags {
         COPY_REFLINK    = 0x1,      /* try to reflink */
         COPY_MERGE      = 0x2,      /* merge existing trees with our new one to copy */
         COPY_REPLACE    = 0x4,      /* replace an existing file if there's one */
 } CopyFlags;
 
+#if 0 /// UNNEEDED by elogind
 int copy_file_fd(const char *from, int to, CopyFlags copy_flags);
 int copy_file(const char *from, const char *to, int open_flags, mode_t mode, unsigned chattr_flags, CopyFlags copy_flags);
 int copy_file_atomic(const char *from, const char *to, mode_t mode, unsigned chattr_flags, CopyFlags copy_flags);
@@ -40,7 +38,9 @@ int copy_tree(const char *from, const char *to, uid_t override_uid, gid_t overri
 int copy_tree_at(int fdf, const char *from, int fdt, const char *to, uid_t override_uid, gid_t override_gid, CopyFlags copy_flags);
 int copy_directory_fd(int dirfd, const char *to, CopyFlags copy_flags);
 int copy_directory(const char *from, const char *to, CopyFlags copy_flags);
+#endif // 0
 int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags copy_flags);
+#if 0 /// UNNEEDED by elogind
 int copy_times(int fdf, int fdt);
 int copy_xattr(int fdf, int fdt);
 #endif // 0
index ded6e56968e56f24f85f74b5fb1bdc1e72773f08..03238151c64694ea3222292ce2acbfae3f2d2c7f 100644 (file)
@@ -713,6 +713,7 @@ int load_env_file(FILE *f, const char *fname, const char *newline, char ***rl) {
         *rl = m;
         return 0;
 }
+#endif // 0
 
 static int load_env_file_push_pairs(
                 const char *filename, unsigned line,
@@ -762,6 +763,7 @@ int load_env_file_pairs(FILE *f, const char *fname, const char *newline, char **
         *rl = m;
         return 0;
 }
+#if 0 /// UNNEEDED by elogind
 
 static int merge_env_file_push(
                 const char *filename, unsigned line,
@@ -1312,6 +1314,7 @@ int fputs_with_space(FILE *f, const char *s, const char *separator, bool *space)
 
         return fputs(s, f);
 }
+#endif // 0
 
 int open_tmpfile_unlinkable(const char *directory, int flags) {
         char *p;
@@ -1342,6 +1345,7 @@ int open_tmpfile_unlinkable(const char *directory, int flags) {
         return fd;
 }
 
+#if 0 /// UNNEEDED by elogind
 int open_tmpfile_linkable(const char *target, int flags, char **ret_path) {
         _cleanup_free_ char *tmp = NULL;
         int r, fd;
@@ -1385,6 +1389,7 @@ int open_tmpfile_linkable(const char *target, int flags, char **ret_path) {
 
         return fd;
 }
+#endif // 0
 
 int open_serialization_fd(const char *ident) {
         int fd = -1;
@@ -1405,6 +1410,7 @@ int open_serialization_fd(const char *ident) {
         return fd;
 }
 
+#if 0 /// UNNEEDED by elogind
 int link_tmpfile(int fd, const char *path, const char *target) {
 
         assert(fd >= 0);
index 50ccb6d14b9c1236ff50e49f282aea33e0967ca7..860d9e15db01c4eadf6884d61b9ea423d4ff06f7 100644 (file)
@@ -47,8 +47,10 @@ int verify_file(const char *fn, const char *blob, bool accept_extra_nl);
 int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
 #if 0 /// UNNEEDED by elogind
 int load_env_file(FILE *f, const char *fname, const char *separator, char ***l);
+#endif // 0
 int load_env_file_pairs(FILE *f, const char *fname, const char *separator, char ***l);
 
+#if 0 /// UNNEEDED by elogind
 int write_env_file(const char *fname, char **l);
 
 int executable_is_script(const char *path, char **interpreter);
@@ -86,11 +88,15 @@ int write_timestamp_file_atomic(const char *fn, usec_t n);
 int read_timestamp_file(const char *fn, usec_t *ret);
 
 int fputs_with_space(FILE *f, const char *s, const char *separator, bool *space);
+#endif // 0
 
 int open_tmpfile_unlinkable(const char *directory, int flags);
+#if 0 /// UNNEEDED by elogind
 int open_tmpfile_linkable(const char *target, int flags, char **ret_path);
+#endif // 0
 int open_serialization_fd(const char *ident);
 
+#if 0 /// UNNEEDED by elogind
 int link_tmpfile(int fd, const char *path, const char *target);
 #endif // 0
 
index f6fb7cabc48a8c7ab198fe5fb252c62a096f9b8b..6308216deeaab1129dc04b54a9baa91f121540ce 100644 (file)
@@ -37,6 +37,7 @@
 #include "mkdir.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 //#include "time-util.h"
@@ -491,7 +492,6 @@ int get_files_in_directory(const char *path, char ***list) {
         return n;
 }
 
-#if 0 /// UNNEEDED by elogind
 static int getenv_tmp_dir(const char **ret_path) {
         const char *n;
         int r, ret = 0;
@@ -562,6 +562,7 @@ static int tmp_dir_internal(const char *def, const char **ret) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int var_tmp_dir(const char **ret) {
 
         /* Returns the location for "larger" temporary files, that is backed by physical storage if available, and thus
@@ -571,6 +572,7 @@ int var_tmp_dir(const char **ret) {
 
         return tmp_dir_internal("/var/tmp", ret);
 }
+#endif // 0
 
 int tmp_dir(const char **ret) {
 
@@ -580,6 +582,7 @@ int tmp_dir(const char **ret) {
         return tmp_dir_internal("/tmp", ret);
 }
 
+#if 0 /// UNNEEDED by elogind
 int inotify_add_watch_fd(int fd, int what, uint32_t mask) {
         char path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
         int r;
@@ -593,6 +596,7 @@ int inotify_add_watch_fd(int fd, int what, uint32_t mask) {
 
         return r;
 }
+#endif // 0
 
 int chase_symlinks(const char *path, const char *original_root, unsigned flags, char **ret) {
         _cleanup_free_ char *buffer = NULL, *done = NULL, *root = NULL;
@@ -806,4 +810,3 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
 
         return exists;
 }
-#endif // 0
index 60f465a4d919bf2a301bdd66c916c6994b732a29..65d57797314c3158bcf4f5907b6e803c64a36261 100644 (file)
@@ -72,8 +72,8 @@ int mkfifo_atomic(const char *path, mode_t mode);
 
 int get_files_in_directory(const char *path, char ***list);
 
-#if 0 /// UNNEEDED by elogind
 int tmp_dir(const char **ret);
+#if 0 /// UNNEEDED by elogind
 int var_tmp_dir(const char **ret);
 
 #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
index beadd70ac1da9d32bddeb3a3395493d4aa9ccacd..5c6d8a98cca0c77d2231b83b24c9cda7a9abd488 100644 (file)
@@ -1051,7 +1051,6 @@ struct btrfs_ioctl_quota_ctl_args {
 typedef int32_t key_serial_t;
 #endif
 
-#if 0 /// UNNEEDED by elogind
 #ifndef KEYCTL_JOIN_SESSION_KEYRING
 #define KEYCTL_JOIN_SESSION_KEYRING 1
 #endif
@@ -1109,7 +1108,6 @@ typedef int32_t key_serial_t;
 #ifndef KEY_SPEC_USER_KEYRING
 #define KEY_SPEC_USER_KEYRING -4
 #endif
-#endif // 0
 
 #ifndef KEY_SPEC_SESSION_KEYRING
 #define KEY_SPEC_SESSION_KEYRING -3
index 5a392517c318810479d12e48230112adf2cf5b6e..036b0055b2d1bdcb06c95a8c4fde7fa3540517a8 100644 (file)
@@ -188,7 +188,7 @@ static inline pid_t raw_getpid(void) {
         return (pid_t) syscall(__NR_getpid);
 #endif
 }
-
+#endif // 0
 /* ======================================================================= */
 
 #if !HAVE_DECL_RENAMEAT2
@@ -269,7 +269,6 @@ static inline key_serial_t request_key(const char *type, const char *description
 #  endif
 }
 #endif
-#endif // 0
 
 /* ======================================================================= */
 
index 05384c26b619b8a86beb6207ce1eb55ee5e17a06..6c47620299842b7191ed32ebf643e839770a3249 100644 (file)
@@ -608,6 +608,7 @@ int mkfs_exists(const char *fstype) {
         mkfs = strjoina("mkfs.", fstype);
         return binary_is_good(mkfs);
 }
+#endif // 0
 
 char *prefix_root(const char *root, const char *path) {
         char *n, *p;
@@ -643,6 +644,7 @@ char *prefix_root(const char *root, const char *path) {
         return n;
 }
 
+#if 0 /// UNNEEDED by elogind
 int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg) {
         char *p;
         int r;
index 59a41e7ea4ea76f878f20a0675dde64bcaf7fd9f..e2eba45a3d1cdf0a1e5ba275fa2f75b4f7d26721 100644 (file)
@@ -110,6 +110,7 @@ static bool relaxed_equal_char(char a, char b) {
                 (a == '-' && b == '_');
 }
 
+#if 0 /// UNNEEDED by elogind
 char *proc_cmdline_key_startswith(const char *s, const char *prefix) {
 
         assert(s);
@@ -123,6 +124,7 @@ char *proc_cmdline_key_startswith(const char *s, const char *prefix) {
 
         return (char*) s;
 }
+#endif // 0
 
 bool proc_cmdline_key_streq(const char *x, const char *y) {
         assert(x);
@@ -137,6 +139,7 @@ bool proc_cmdline_key_streq(const char *x, const char *y) {
         return true;
 }
 
+#if 0 /// UNNEEDED by elogind
 int proc_cmdline_get_key(const char *key, unsigned flags, char **value) {
         _cleanup_free_ char *line = NULL, *ret = NULL;
         bool found = false;
@@ -236,7 +239,6 @@ int proc_cmdline_get_bool(const char *key, bool *ret) {
         return 1;
 }
 
-#if 0 /// UNNEEDED by elogind
 int shall_restore_state(void) {
         bool ret;
         int r;
index b872fff056ed5f320e9a8a30aa18431341851182..46d0d76ff2d41f7e403ae727f9e331d3782e5ed5 100644 (file)
@@ -32,15 +32,17 @@ typedef int (*proc_cmdline_parse_t)(const char *key, const char *value, void *da
 
 int proc_cmdline(char **ret);
 
-#if 0 /// UNNEEDED by elogind
 int proc_cmdline_parse(const proc_cmdline_parse_t parse, void *userdata, unsigned flags);
 
+#if 0 /// UNNEEDED by elogind
 int proc_cmdline_get_key(const char *parameter, unsigned flags, char **value);
 int proc_cmdline_get_bool(const char *key, bool *ret);
 
 char *proc_cmdline_key_startswith(const char *s, const char *prefix);
+#endif // 0
 bool proc_cmdline_key_streq(const char *x, const char *y);
 
+#if 0 /// UNNEEDED by elogind
 int shall_restore_state(void);
 const char* runlevel_to_target(const char *rl);
 #endif // 0
index 38c7c100971dc3ff2e165107e69d0aff6a35c2cc..e8c2fc6dd38f55c9b0085d1bdeecfcfd39cf440c 100644 (file)
@@ -66,11 +66,11 @@ static inline bool isempty(const char *p) {
         return !p || !p[0];
 }
 
-#if 0 /// UNNEEDED by elogind
 static inline const char *empty_to_null(const char *p) {
         return isempty(p) ? NULL : p;
 }
 
+#if 0 /// UNNEEDED by elogind
 static inline const char *strdash_if_empty(const char *str) {
         return isempty(str) ? "-" : str;
 }
index c98e956fd92ce7be1cfa5a8e55e0276f77f59163..fc0b2c4af58af9d3feb89863ca0c903bc36d764e 100644 (file)
@@ -322,6 +322,7 @@ char **strv_split_newlines(const char *s) {
 
         return l;
 }
+#endif // 0
 
 int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags) {
         _cleanup_strv_free_ char **l = NULL;
@@ -360,7 +361,6 @@ int strv_split_extract(char ***t, const char *s, const char *separators, Extract
 
         return (int) n;
 }
-#endif // 0
 
 char *strv_join(char **l, const char *separator) {
         char *r, *e;
index 0a908c89345db05ffc25fe1d89c7a6251fa2094f..dafb4fdc1ba2fee161496bc9153d5232faa55360 100644 (file)
@@ -90,9 +90,9 @@ static inline bool strv_isempty(char * const *l) {
 char **strv_split(const char *s, const char *separator);
 #if 0 /// UNNEEDED by elogind
 char **strv_split_newlines(const char *s);
+#endif // 0
 
 int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags);
-#endif // 0
 
 char *strv_join(char **l, const char *separator);
 #if 0 /// UNNEEDED by elogind