From a683e1878913969ccf8b0defdec4d955e15ed75a Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 7 Jul 2017 11:33:14 +0200 Subject: Prep v232.2: Mask more unneeded functions --- src/basic/cgroup-util.h | 2 +- src/basic/fs-util.c | 2 +- src/basic/fs-util.h | 2 +- src/basic/mount-util.c | 2 ++ src/basic/mount-util.h | 2 ++ src/basic/socket-util.c | 2 ++ src/basic/socket-util.h | 2 ++ src/basic/string-util.c | 4 ++++ src/basic/string-util.h | 8 ++++++++ src/basic/time-util.h | 2 ++ src/basic/user-util.c | 2 ++ src/basic/user-util.h | 2 ++ src/basic/virt.c | 2 +- src/basic/virt.h | 2 +- 14 files changed, 31 insertions(+), 5 deletions(-) (limited to 'src/basic') diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index 3b6319245..73fce35a0 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -184,9 +184,9 @@ 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); +#if 0 /// UNNEEDED by elogind int cg_get_keyed_attribute(const char *controller, const char *path, const char *attribute, const char **keys, char **values); -#if 0 /// UNNEEDED by elogind 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); diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 55f606ceb..59787552d 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -602,7 +602,6 @@ int inotify_add_watch_fd(int fd, int what, uint32_t mask) { return r; } -#endif // 0 int chase_symlinks(const char *path, const char *_root, char **ret) { _cleanup_free_ char *buffer = NULL, *done = NULL, *root = NULL; @@ -786,3 +785,4 @@ int chase_symlinks(const char *path, const char *_root, char **ret) { return 0; } +#endif // 0 diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index 08d24fd9b..871f7209f 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -89,6 +89,6 @@ union inotify_event_buffer { }; int inotify_add_watch_fd(int fd, int what, uint32_t mask); -#endif // 0 int chase_symlinks(const char *path, const char *_root, char **ret); +#endif // 0 diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c index 32e42d6a3..e2bdfcd8a 100644 --- a/src/basic/mount-util.c +++ b/src/basic/mount-util.c @@ -584,6 +584,7 @@ const char* mode_to_inaccessible_node(mode_t mode) { return NULL; } +#if 0 /// UNNEEDED by elogind #define FLAG(name) (flags & name ? STRINGIFY(name) "|" : "") static char* mount_flags_to_string(long unsigned flags) { char *x; @@ -688,3 +689,4 @@ int umount_verbose(const char *what) { return log_error_errno(errno, "Failed to unmount %s: %m", what); return 0; } +#endif // 0 diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h index 33453aa9f..d538ea953 100644 --- a/src/basic/mount-util.h +++ b/src/basic/mount-util.h @@ -57,6 +57,7 @@ const char* mode_to_inaccessible_node(mode_t mode); #define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ } +#if 0 /// UNNEEDED by elogind int mount_verbose( int error_log_level, const char *what, @@ -65,3 +66,4 @@ int mount_verbose( unsigned long flags, const char *options); int umount_verbose(const char *where); +#endif // 0 diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index a983c67a8..4c1869353 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -1067,6 +1067,7 @@ struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t leng return NULL; } +#if 0 /// UNNEEDED by elogind int socket_ioctl_fd(void) { int fd; @@ -1083,3 +1084,4 @@ int socket_ioctl_fd(void) { return fd; } +#endif // 0 diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 93454f6ac..718de9ba3 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -163,4 +163,6 @@ struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t leng strnlen(_sa->sun_path, sizeof(_sa->sun_path))); \ }) +#if 0 /// UNNEEDED by elogind int socket_ioctl_fd(void); +#endif // 0 diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 6b06e643c..ebe146b03 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -292,6 +292,7 @@ char *strstrip(char *s) { return s; } +#if 0 /// UNNEEDED by elogind char *delete_chars(char *s, const char *bad) { char *f, *t; @@ -308,6 +309,7 @@ char *delete_chars(char *s, const char *bad) { return s; } +#endif // 0 char *truncate_nl(char *s) { assert(s); @@ -316,6 +318,7 @@ char *truncate_nl(char *s) { return s; } +#if 0 /// UNNEEDED by elogind char ascii_tolower(char x) { if (x >= 'A' && x <= 'Z') @@ -406,6 +409,7 @@ bool chars_intersect(const char *a, const char *b) { return false; } +#endif // 0 bool string_has_cc(const char *p, const char *ok) { const char *t; diff --git a/src/basic/string-util.h b/src/basic/string-util.h index d029d538b..66e55cb2c 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -66,6 +66,7 @@ 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; } @@ -73,6 +74,7 @@ static inline const char *empty_to_null(const char *p) { static inline const char *strdash_if_empty(const char *str) { return isempty(str) ? "-" : str; } +#endif // 0 static inline char *startswith(const char *s, const char *prefix) { size_t l; @@ -84,6 +86,7 @@ static inline char *startswith(const char *s, const char *prefix) { return NULL; } +#if 0 /// UNNEEDED by elogind static inline char *startswith_no_case(const char *s, const char *prefix) { size_t l; @@ -93,6 +96,7 @@ static inline char *startswith_no_case(const char *s, const char *prefix) { return NULL; } +#endif // 0 char *endswith(const char *s, const char *postfix) _pure_; char *endswith_no_case(const char *s, const char *postfix) _pure_; @@ -134,9 +138,12 @@ char *strjoin(const char *x, ...) _sentinel_; }) char *strstrip(char *s); +#if 0 /// UNNEEDED by elogind char *delete_chars(char *s, const char *bad); +#endif // 0 char *truncate_nl(char *s); +#if 0 /// UNNEEDED by elogind char ascii_tolower(char x); char *ascii_strlower(char *s); char *ascii_strlower_n(char *s, size_t n); @@ -148,6 +155,7 @@ int ascii_strcasecmp_n(const char *a, const char *b, size_t n); int ascii_strcasecmp_nn(const char *a, size_t n, const char *b, size_t m); bool chars_intersect(const char *a, const char *b) _pure_; +#endif // 0 static inline bool _pure_ in_charset(const char *s, const char* charset) { assert(s); diff --git a/src/basic/time-util.h b/src/basic/time-util.h index 4421afc66..eab708c28 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -115,7 +115,9 @@ static inline bool triple_timestamp_is_set(triple_timestamp *ts) { usec_t triple_timestamp_by_clock(triple_timestamp *ts, clockid_t clock); usec_t timespec_load(const struct timespec *ts) _pure_; +#if 0 /// UNNEEDED by elogind nsec_t timespec_load_nsec(const struct timespec *ts) _pure_; +#endif // 0 struct timespec *timespec_store(struct timespec *ts, usec_t u); usec_t timeval_load(const struct timeval *tv) _pure_; diff --git a/src/basic/user-util.c b/src/basic/user-util.c index 2656d96c2..9ef19a1f6 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -179,6 +179,7 @@ int get_user_creds( return 0; } +#if 0 /// UNNEEDED by elogind int get_user_creds_clean( const char **username, uid_t *uid, gid_t *gid, @@ -249,6 +250,7 @@ int get_group_creds(const char **groupname, gid_t *gid) { return 0; } +#endif // 0 char* uid_to_name(uid_t uid) { char *ret; diff --git a/src/basic/user-util.h b/src/basic/user-util.h index 0d000b76c..4a1bc764a 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -42,8 +42,10 @@ char* getusername_malloc(void); #endif // 0 int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell); +#if 0 /// UNNEEDED by elogind int get_user_creds_clean(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell); int get_group_creds(const char **groupname, gid_t *gid); +#endif // 0 char* uid_to_name(uid_t uid); char* gid_to_name(gid_t gid); diff --git a/src/basic/virt.c b/src/basic/virt.c index 06fe509f7..35beebe7f 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -486,7 +486,6 @@ int detect_virtualization(void) { return r; } -#endif // 0 static int userns_has_mapping(const char *name) { _cleanup_fclose_ FILE *f = NULL; @@ -557,6 +556,7 @@ int running_in_userns(void) { log_debug("/proc/self/setgroups contains \"%s\", %s user namespace", line, r ? "in" : "not in"); return r; } +#endif // 0 int running_in_chroot(void) { int ret; diff --git a/src/basic/virt.h b/src/basic/virt.h index 8bcddb761..f448f4e8f 100644 --- a/src/basic/virt.h +++ b/src/basic/virt.h @@ -69,9 +69,9 @@ int detect_vm(void); int detect_container(void); #if 0 /// UNNEEDED by elogind int detect_virtualization(void); -#endif // 0 int running_in_userns(void); +#endif // 0 int running_in_chroot(void); const char *virtualization_to_string(int v) _const_; -- cgit v1.2.3