From 9b00a533195b7fec54a791ca02090e0799214770 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 17 Jul 2017 17:13:52 +0200 Subject: Prep v233: Unmask now needed functions in src/basic --- src/basic/cgroup-util.h | 2 +- src/basic/conf-files.c | 2 +- src/basic/conf-files.h | 2 +- src/basic/copy.h | 6 +++--- src/basic/fileio.c | 6 ++++++ src/basic/fileio.h | 6 ++++++ src/basic/fs-util.c | 7 +++++-- src/basic/fs-util.h | 2 +- src/basic/missing.h | 2 -- src/basic/missing_syscall.h | 3 +-- src/basic/path-util.c | 2 ++ src/basic/proc-cmdline.c | 4 +++- src/basic/proc-cmdline.h | 4 +++- src/basic/string-util.h | 2 +- src/basic/strv.c | 2 +- src/basic/strv.h | 2 +- 16 files changed, 36 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index d8b6ef3dc..ac115b4b7 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -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); diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index 417bc5a5b..1cd0d9dfc 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -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; diff --git a/src/basic/conf-files.h b/src/basic/conf-files.h index e77fdd472..3e684364c 100644 --- a/src/basic/conf-files.h +++ b/src/basic/conf-files.h @@ -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); diff --git a/src/basic/copy.h b/src/basic/copy.h index d3aabf36a..d46f1c92a 100644 --- a/src/basic/copy.h +++ b/src/basic/copy.h @@ -24,15 +24,13 @@ #include #include -#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 diff --git a/src/basic/fileio.c b/src/basic/fileio.c index ded6e5696..03238151c 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -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); diff --git a/src/basic/fileio.h b/src/basic/fileio.h index 50ccb6d14..860d9e15d 100644 --- a/src/basic/fileio.h +++ b/src/basic/fileio.h @@ -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 diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index f6fb7cabc..6308216de 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -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 diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index 60f465a4d..65d577973 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -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) diff --git a/src/basic/missing.h b/src/basic/missing.h index beadd70ac..5c6d8a98c 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -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 diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 5a392517c..036b0055b 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -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 /* ======================================================================= */ diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 05384c26b..6c4762029 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -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; diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c index 59a41e7ea..e2eba45a3 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -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; diff --git a/src/basic/proc-cmdline.h b/src/basic/proc-cmdline.h index b872fff05..46d0d76ff 100644 --- a/src/basic/proc-cmdline.h +++ b/src/basic/proc-cmdline.h @@ -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 diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 38c7c1009..e8c2fc6dd 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -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; } diff --git a/src/basic/strv.c b/src/basic/strv.c index c98e956fd..fc0b2c4af 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -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; diff --git a/src/basic/strv.h b/src/basic/strv.h index 0a908c893..dafb4fdc1 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -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 -- cgit v1.2.3