chiark / gitweb /
Prep v232.2: Mask more unneeded functions
authorSven Eden <yamakuzure@gmx.net>
Fri, 7 Jul 2017 09:33:14 +0000 (11:33 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 7 Jul 2017 09:33:14 +0000 (11:33 +0200)
21 files changed:
cb/elogind.cbp
src/basic/cgroup-util.h
src/basic/fs-util.c
src/basic/fs-util.h
src/basic/mount-util.c
src/basic/mount-util.h
src/basic/socket-util.c
src/basic/socket-util.h
src/basic/string-util.c
src/basic/string-util.h
src/basic/time-util.h
src/basic/user-util.c
src/basic/user-util.h
src/basic/virt.c
src/basic/virt.h
src/libelogind/sd-id128/id128-util.c
src/libelogind/sd-id128/id128-util.h
src/shared/clean-ipc.c
src/shared/clean-ipc.h
src/shared/conf-parser.c
src/shared/conf-parser.h

index 8524706f5e180aa03607e9e29460187a0de370b8..90317eda88b12a5af75b3525c5c7ed5fd93b8c35 100644 (file)
                <Unit filename="../src/libelogind/sd-event/sd-event.c">
                        <Option compilerVar="CC" />
                </Unit>
+               <Unit filename="../src/libelogind/sd-id128/id128-util.c">
+                       <Option compilerVar="CC" />
+               </Unit>
+               <Unit filename="../src/libelogind/sd-id128/id128-util.h" />
                <Unit filename="../src/libelogind/sd-id128/sd-id128.c">
                        <Option compilerVar="CC" />
                </Unit>
index 3b63192459ee2469fda93cfa2bb36def3f649a08..73fce35a010c979b706e7e320e2634ae70e06053 100644 (file)
@@ -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);
 
index 55f606cebc23d223150d44d427dd82c9dad83754..59787552d2618519f5ff2e04c886188f321c0326 100644 (file)
@@ -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
index 08d24fd9b0579e484a4ae13e2c51abb57532b926..871f7209f2f2ed3a1abbb428f05307a18ed1fbf5 100644 (file)
@@ -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
index 32e42d6a320edb43f02475bea5dc0ee21308f221..e2bdfcd8a7c9d711e83fc9724a6dd72d5d52d23f 100644 (file)
@@ -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
index 33453aa9fb20c4d869ce46b03c0a424bc0c8a8fb..d538ea9533ac59b0906efec374d27c0c40cb69ae 100644 (file)
@@ -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
index a983c67a826a0ddcd2a49ed09f11177669b764f4..4c1869353f31ff9d9e4f97ee92c2668105e5e27b 100644 (file)
@@ -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
index 93454f6ac3a644a926df7ae5d8100ca4b08cb61c..718de9ba347ff07a8fd2618fd10a08735ced4423 100644 (file)
@@ -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
index 6b06e643c99398f6226d788589eeb04c70854abd..ebe146b03d817eab23e85990ce121fcf7c5a7b37 100644 (file)
@@ -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;
index d029d538bd5ea46ab5cbb26cbc8ef9508623db82..66e55cb2c615ab8cbab8fce97cd730068d395772 100644 (file)
@@ -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);
index 4421afc66f6f64eec2e422630a9d6dcb6449ca37..eab708c2817e7450ceccfc123ca0da27534728a4 100644 (file)
@@ -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_;
index 2656d96c2096a59deffc5898bfea7f71f8a48fdb..9ef19a1f692df044c5c2f410e77e45e3efb6e55a 100644 (file)
@@ -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;
index 0d000b76c88eac66272eca1ab340a896ff7c49dd..4a1bc764ad586d3e35db3f86a47503afbc49f20d 100644 (file)
@@ -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);
index 06fe509f772ab4042b7cb5e122fabdfa2182908f..35beebe7fa4116f5dedfd2b2a0e50fd0cc97486c 100644 (file)
@@ -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;
index 8bcddb7619f436e367d7867f216f91c27e94b7aa..f448f4e8fbc0afe8190c2f7e1f73a8ba18a4cba5 100644 (file)
@@ -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_;
index 337eae24b45132adfd5c8f1ba6f7dfe7e094ca36..a6687b0c9327b36c04bc358826f5989c6449a865 100644 (file)
@@ -153,6 +153,7 @@ int id128_read(const char *p, Id128Format f, sd_id128_t *ret) {
         return id128_read_fd(fd, f, ret);
 }
 
+#if 0 /// UNNEEDED by elogind
 int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync) {
         char buffer[36 + 2];
         size_t sz;
@@ -205,3 +206,4 @@ const struct hash_ops id128_hash_ops = {
         .hash = id128_hash_func,
         .compare = id128_compare_func,
 };
+#endif // 0
index 6b3855acbbba3f6268533dcaa40119ddffb29ef3..e5262cdcda200c956c8442caff1df5df03467f91 100644 (file)
@@ -43,9 +43,11 @@ typedef enum Id128Format {
 int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret);
 int id128_read(const char *p, Id128Format f, sd_id128_t *ret);
 
+#if 0 /// UNNEEDED by elogind
 int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync);
 int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync);
 
 void id128_hash_func(const void *p, struct siphash *state);
 int id128_compare_func(const void *a, const void *b) _pure_;
 extern const struct hash_ops id128_hash_ops;
+#endif // 0
index 567dbbc991bda0680da850700998f6e409b1d028..8c60bdc1f2be77ae301b7d95a96ccde5ac87690d 100644 (file)
@@ -388,6 +388,8 @@ int clean_ipc_by_uid(uid_t uid) {
         return clean_ipc(uid, GID_INVALID);
 }
 
+#if 0 /// UNNEEDED by elogind
 int clean_ipc_by_gid(gid_t gid) {
         return clean_ipc(UID_INVALID, gid);
 }
+#endif // 0
index 6ca57f44fdd0e53e15363f11957a63dbd787ae10..7cd896df0ec36f04b722fd162f5ae1ed5649a5e2 100644 (file)
@@ -23,4 +23,6 @@
 
 int clean_ipc(uid_t uid, gid_t gid);
 int clean_ipc_by_uid(uid_t uid);
+#if 0 /// UNNEEDED by elogind
 int clean_ipc_by_gid(gid_t gid);
+#endif // 0
index 9190ec9b85bfd1bef75d61bc1ecaa4b3d63918c6..90f3167f523dc39233743d0b0f6b9027e9456bc8 100644 (file)
@@ -507,8 +507,10 @@ int config_parse_many(
 
 DEFINE_PARSER(int, int, safe_atoi);
 DEFINE_PARSER(long, long, safe_atoli);
+#if 0 /// UNNEEDED by elogind
 DEFINE_PARSER(uint16, uint16_t, safe_atou16);
 DEFINE_PARSER(uint32, uint32_t, safe_atou32);
+#endif // 0
 DEFINE_PARSER(uint64, uint64_t, safe_atou64);
 DEFINE_PARSER(unsigned, unsigned, safe_atou);
 DEFINE_PARSER(double, double, safe_atod);
index fe93c3c1e0b0ff47a3f905c98b23e718fab58f1b..76d60232208394ec14e727d5d063f42c1f3cc3e4 100644 (file)
@@ -121,8 +121,10 @@ int config_parse_many(
 int config_parse_int(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unsigned(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_long(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+#if 0 /// UNNEEDED by elogind
 int config_parse_uint16(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_uint32(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+#endif // 0
 int config_parse_uint64(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_double(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line,  const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_iec_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);