From 166f4e4fb53a82900ff9ae080e0ff37d35d4dacd Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Tue, 11 Apr 2017 17:28:14 +0200 Subject: [PATCH] Prep v228: Condense elogind source masks (3/5) --- src/basic/smack-util.h | 6 ++---- src/basic/socket-util.c | 12 ++++-------- src/basic/socket-util.h | 12 ++++-------- src/basic/stat-util.c | 15 +++++---------- src/basic/stat-util.h | 15 +++++---------- src/basic/strv.c | 21 +++++++-------------- src/basic/strv.h | 27 +++++++++------------------ src/basic/syslog-util.c | 9 +++------ src/basic/syslog-util.h | 6 ++---- src/basic/terminal-util.c | 21 +++++++-------------- src/basic/terminal-util.h | 24 ++++++++---------------- src/basic/time-util.c | 21 +++++++-------------- src/basic/time-util.h | 24 ++++++++---------------- src/basic/unit-name.c | 9 +++------ src/basic/unit-name.h | 12 ++++-------- src/basic/user-util.c | 9 +++------ src/basic/user-util.h | 9 +++------ src/basic/virt.c | 3 +-- src/basic/virt.h | 3 +-- src/basic/xattr-util.c | 3 +-- src/basic/xattr-util.h | 3 +-- src/core/cgroup.c | 6 ++---- src/core/cgroup.h | 6 ++---- 23 files changed, 92 insertions(+), 184 deletions(-) diff --git a/src/basic/smack-util.h b/src/basic/smack-util.h index c7a4eb36a..08caf90c8 100644 --- a/src/basic/smack-util.h +++ b/src/basic/smack-util.h @@ -30,8 +30,7 @@ #define SMACK_FLOOR_LABEL "_" #define SMACK_STAR_LABEL "*" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind typedef enum SmackAttr { SMACK_ATTR_ACCESS = 0, SMACK_ATTR_EXEC = 1, @@ -48,8 +47,7 @@ bool mac_smack_use(void); int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind const char* smack_attr_to_string(SmackAttr i) _const_; SmackAttr smack_attr_from_string(const char *s) _pure_; int mac_smack_read(const char *path, SmackAttr attr, char **label); diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 56a40a1de..563c7db60 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -44,8 +44,7 @@ #include "user-util.h" #include "util.h" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int socket_address_parse(SocketAddress *a, const char *s) { char *e, *n; unsigned u; @@ -453,8 +452,7 @@ bool socket_ipv6_is_supported(void) { return l[0] == '0'; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool socket_address_matches_fd(const SocketAddress *a, int fd) { SocketAddress b; socklen_t solen; @@ -797,8 +795,7 @@ int fd_inc_rcvbuf(int fd, size_t n) { return 1; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind static const char* const ip_tos_table[] = { [IPTOS_LOWDELAY] = "low-delay", [IPTOS_THROUGHPUT] = "throughput", @@ -903,8 +900,7 @@ int send_one_fd(int transport_fd, int fd, int flags) { return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int receive_one_fd(int transport_fd, int flags) { union { struct cmsghdr cmsghdr; diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 2924c30bf..6cd67ffa0 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -41,8 +41,7 @@ union sockaddr_union { struct sockaddr_ll ll; }; -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind typedef struct SocketAddress { union sockaddr_union sockaddr; @@ -102,8 +101,7 @@ const char* socket_address_get_path(const SocketAddress *a); bool socket_ipv6_is_supported(void); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int sockaddr_port(const struct sockaddr *_sa) _pure_; Sint sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret); @@ -124,8 +122,7 @@ bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b int fd_inc_sndbuf(int fd, size_t n); int fd_inc_rcvbuf(int fd, size_t n); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int ip_tos_to_string_alloc(int i, char **s); int ip_tos_from_string(const char *s); #endif // 0 @@ -134,8 +131,7 @@ int getpeercred(int fd, struct ucred *ucred); int getpeersec(int fd, char **ret); int send_one_fd(int transport_fd, int fd, int flags); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int receive_one_fd(int transport_fd, int flags); #endif // 0 diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index baa3b5c82..5bc11e4a3 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -31,8 +31,7 @@ #include "stat-util.h" #include "string-util.h" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int is_symlink(const char *path) { struct stat info; @@ -61,8 +60,7 @@ int is_dir(const char* path, bool follow) { return !!S_ISDIR(st.st_mode); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int is_device_node(const char *path) { struct stat info; @@ -115,8 +113,7 @@ int null_or_empty_path(const char *fn) { return null_or_empty(&st); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int null_or_empty_fd(int fd) { struct stat st; @@ -149,8 +146,7 @@ int path_is_read_only_fs(const char *path) { return false; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int path_is_os_tree(const char *path) { char *p; int r; @@ -194,8 +190,7 @@ bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) { return F_TYPE_EQUAL(s->f_type, magic_value); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int fd_check_fstype(int fd, statfs_f_type_t magic_value) { struct statfs s; diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h index 23e00885f..692389825 100644 --- a/src/basic/stat-util.h +++ b/src/basic/stat-util.h @@ -28,13 +28,11 @@ #include "macro.h" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int is_symlink(const char *path); #endif // 0 int is_dir(const char *path, bool follow); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int is_device_node(const char *path); int dir_is_empty(const char *path); @@ -50,14 +48,12 @@ static inline int dir_is_populated(const char *path) { bool null_or_empty(struct stat *st) _pure_; int null_or_empty_path(const char *fn); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int null_or_empty_fd(int fd); #endif // 0 int path_is_read_only_fs(const char *path); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int path_is_os_tree(const char *path); #endif // 0 @@ -69,8 +65,7 @@ int files_same(const char *filea, const char *fileb); typedef long statfs_f_type_t; bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_; -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int fd_check_fstype(int fd, statfs_f_type_t magic_value); int path_check_fstype(const char *path, statfs_f_type_t magic_value); #endif // 0 diff --git a/src/basic/strv.c b/src/basic/strv.c index 7401c2908..825fdcbdf 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -244,8 +244,7 @@ rollback: return -ENOMEM; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_extend_strv_concat(char ***a, char **b, const char *suffix) { int r; char **s; @@ -299,8 +298,7 @@ char **strv_split(const char *s, const char *separator) { return r; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char **strv_split_newlines(const char *s) { char **l; unsigned n; @@ -397,8 +395,7 @@ char *strv_join(char **l, const char *separator) { return r; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *strv_join_quoted(char **l) { char *buf = NULL; char **s; @@ -530,8 +527,7 @@ int strv_consume(char ***l, char *value) { return r; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_consume_pair(char ***l, char *a, char *b) { int r; @@ -580,8 +576,7 @@ char **strv_uniq(char **l) { return l; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool strv_is_uniq(char **l) { char **i; @@ -676,8 +671,7 @@ char **strv_split_nulstr(const char *s) { return r; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_make_nulstr(char **l, char **p, size_t *q) { size_t n_allocated = 0, n = 0; _cleanup_free_ char *m = NULL; @@ -739,8 +733,7 @@ char **strv_sort(char **l) { return l; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool strv_equal(char **a, char **b) { if (strv_isempty(a)) diff --git a/src/basic/strv.h b/src/basic/strv.h index d90527c6f..481829cac 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -46,29 +46,25 @@ char **strv_copy(char * const *l); unsigned strv_length(char * const *l) _pure_; int strv_extend_strv(char ***a, char **b, bool filter_duplicates); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_extend_strv_concat(char ***a, char **b, const char *suffix); #endif // 0 int strv_extend(char ***l, const char *value); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_extendf(char ***l, const char *format, ...) _printf_(2,0); #endif // 0 int strv_push(char ***l, char *value); int strv_push_pair(char ***l, char *a, char *b); int strv_push_prepend(char ***l, char *value); int strv_consume(char ***l, char *value); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_consume_pair(char ***l, char *a, char *b); #endif // 0 int strv_consume_prepend(char ***l, char *value); char **strv_remove(char **l, const char *s); char **strv_uniq(char **l); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool strv_is_uniq(char **l); bool strv_equal(char **a, char **b); @@ -88,22 +84,19 @@ static inline bool strv_isempty(char * const *l) { } char **strv_split(const char *s, const char *separator); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char **strv_split_newlines(const char *s); int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags); #endif // 0 char *strv_join(char **l, const char *separator); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *strv_join_quoted(char **l); #endif // 0 char **strv_parse_nulstr(const char *s, size_t l); char **strv_split_nulstr(const char *s); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int strv_make_nulstr(char **l, char **p, size_t *n); bool strv_overlap(char **a, char **b) _pure_; @@ -120,8 +113,7 @@ bool strv_overlap(char **a, char **b) _pure_; for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = (x + 1)) char **strv_sort(char **l); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void strv_print(char **l); #endif // 0 @@ -172,8 +164,7 @@ void strv_print(char **l); _l[0]; \ })) -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char **strv_reverse(char **l); char **strv_shell_escape(char **l, const char *bad); diff --git a/src/basic/syslog-util.c b/src/basic/syslog-util.c index 854401aa2..441b2259f 100644 --- a/src/basic/syslog-util.c +++ b/src/basic/syslog-util.c @@ -26,8 +26,7 @@ #include "string-table.h" #include "syslog-util.h" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int syslog_parse_priority(const char **p, int *priority, bool with_facility) { int a = 0, b = 0, c = 0; int k; @@ -96,8 +95,7 @@ static const char *const log_facility_unshifted_table[LOG_NFACILITIES] = { DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(log_facility_unshifted, int, LOG_FAC(~0)); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool log_facility_unshifted_is_valid(int facility) { return facility >= 0 && facility <= LOG_FAC(~0); } @@ -116,8 +114,7 @@ static const char *const log_level_table[] = { DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(log_level, int, LOG_DEBUG); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool log_level_is_valid(int level) { return level >= 0 && level <= LOG_DEBUG; } diff --git a/src/basic/syslog-util.h b/src/basic/syslog-util.h index 15aa83ef1..a34159afb 100644 --- a/src/basic/syslog-util.h +++ b/src/basic/syslog-util.h @@ -25,15 +25,13 @@ int log_facility_unshifted_to_string_alloc(int i, char **s); int log_facility_unshifted_from_string(const char *s); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool log_facility_unshifted_is_valid(int faciliy); #endif // 0 int log_level_to_string_alloc(int i, char **s); int log_level_from_string(const char *s); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool log_level_is_valid(int level); int syslog_parse_priority(const char **p, int *priority, bool with_facility); diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index d34f61e1c..9e7e3b618 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -74,8 +74,7 @@ int chvt(int vt) { return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) { struct termios old_termios, new_termios; char c, line[LINE_MAX]; @@ -352,8 +351,7 @@ int open_terminal(const char *name, int mode) { return fd; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int acquire_terminal( const char *name, bool fail, @@ -503,8 +501,7 @@ fail: } #endif // 0 -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int release_terminal(void) { static const struct sigaction sa_new = { .sa_handler = SIG_IGN, @@ -676,8 +673,7 @@ int vtnr_from_tty(const char *tty) { return i; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *resolve_dev_console(char **active) { char *tty; @@ -804,8 +800,7 @@ unsigned lines(void) { } /* intended to be used as a SIGWINCH sighandler */ -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void columns_lines_cache_reset(int signum) { cached_columns = 0; cached_lines = 0; @@ -855,8 +850,7 @@ int make_null_stdio(void) { return make_stdio(null_fd); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int getttyname_malloc(int fd, char **ret) { size_t l = 100; int r; @@ -999,8 +993,7 @@ int get_ctty(pid_t pid, dev_t *_devnr, char **r) { return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int ptsname_malloc(int fd, char **ret) { size_t l = 100; diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index 3464a053f..136618144 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -42,15 +42,13 @@ /* Set cursor to top left corner and clear screen */ #define ANSI_HOME_CLEAR "\x1B[H\x1B[2J" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int reset_terminal_fd(int fd, bool switch_to_text); int reset_terminal(const char *name); #endif // 0 int open_terminal(const char *name, int mode); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout); int release_terminal(void); @@ -60,8 +58,7 @@ int terminal_vhangup(const char *name); int chvt(int vt); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); int ask_string(char **ret, const char *text, ...) _printf_(2, 3); @@ -71,21 +68,18 @@ int vt_disallocate(const char *name); char *resolve_dev_console(char **active); #endif // 0 bool tty_is_vc(const char *tty); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind bool tty_is_vc_resolve(const char *tty); #endif // 0 bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind const char *default_term_for_tty(const char *tty); #endif // 0 int make_stdio(int fd); int make_null_stdio(void); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int make_console_stdio(void); #endif // 0 @@ -93,8 +87,7 @@ int fd_columns(int fd); unsigned columns(void); int fd_lines(int fd); unsigned lines(void); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void columns_lines_cache_reset(int _unused_ signum); #endif // 0 @@ -135,8 +128,7 @@ static inline const char *ansi_normal(void) { int get_ctty_devnr(pid_t pid, dev_t *d); int get_ctty(pid_t, dev_t *_devnr, char **r); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int getttyname_malloc(int fd, char **r); int getttyname_harder(int fd, char **r); diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 7fb3745d6..f2250947d 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -41,8 +41,7 @@ usec_t now(clockid_t clock_id) { return timespec_load(&ts); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind nsec_t now_nsec(clockid_t clock_id) { struct timespec ts; @@ -83,8 +82,7 @@ dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u) { return ts; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) { int64_t delta; assert(ts); @@ -226,8 +224,7 @@ char *format_timestamp(char *buf, size_t l, usec_t t) { return format_timestamp_internal(buf, l, t, false); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *format_timestamp_utc(char *buf, size_t l, usec_t t) { return format_timestamp_internal(buf, l, t, true); } @@ -259,8 +256,7 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t) { return format_timestamp_internal_us(buf, l, t, false); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *format_timestamp_us_utc(char *buf, size_t l, usec_t t) { return format_timestamp_internal_us(buf, l, t, true); } @@ -439,8 +435,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) { return buf; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) { assert(f); @@ -852,8 +847,7 @@ int parse_sec(const char *t, usec_t *usec) { return parse_time(t, usec, USEC_PER_SEC); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int parse_nsec(const char *t, nsec_t *nsec) { static const struct { const char *suffix; @@ -1150,8 +1144,7 @@ struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc) { return utc ? gmtime_r(t, tm) : localtime_r(t, tm); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind unsigned long usec_to_jiffies(usec_t u) { static thread_local unsigned long hz = 0; long r; diff --git a/src/basic/time-util.h b/src/basic/time-util.h index 1ef78519f..78011a802 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -71,15 +71,13 @@ typedef struct dual_timestamp { #define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0ULL, 0ULL }) usec_t now(clockid_t clock); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind nsec_t now_nsec(clockid_t clock); #endif // 0 dual_timestamp* dual_timestamp_get(dual_timestamp *ts); dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u); dual_timestamp* dual_timestamp_from_boottime_or_monotonic(dual_timestamp *ts, usec_t u); #endif // 0 @@ -98,20 +96,17 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u); nsec_t timespec_load_nsec(const struct timespec *ts) _pure_; char *format_timestamp(char *buf, size_t l, usec_t t); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *format_timestamp_utc(char *buf, size_t l, usec_t t); #endif // 0 char *format_timestamp_us(char *buf, size_t l, usec_t t); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *format_timestamp_us_utc(char *buf, size_t l, usec_t t); #endif // 0 char *format_timestamp_relative(char *buf, size_t l, usec_t t); char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t); int dual_timestamp_deserialize(const char *value, dual_timestamp *t); @@ -120,8 +115,7 @@ int parse_timestamp(const char *t, usec_t *usec); int parse_sec(const char *t, usec_t *usec); int parse_time(const char *t, usec_t *usec, usec_t default_unit); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int parse_nsec(const char *t, nsec_t *nsec); bool ntp_synced(void); @@ -136,15 +130,13 @@ clockid_t clock_boottime_or_monotonic(void); assert_message_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0, \ "xstrftime: " #buf "[] must be big enough") -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int get_timezone(char **timezone); time_t mktime_or_timegm(struct tm *tm, bool utc); #endif // 0 struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind unsigned long usec_to_jiffies(usec_t usec); #endif // 0 diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c index 2e3093b33..b76567dc4 100644 --- a/src/basic/unit-name.c +++ b/src/basic/unit-name.c @@ -122,8 +122,7 @@ bool unit_suffix_is_valid(const char *s) { return true; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int unit_name_to_prefix(const char *n, char **ret) { const char *p; char *s; @@ -271,8 +270,7 @@ int unit_name_build(const char *prefix, const char *instance, const char *suffix return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind static char *do_escape_char(char c, char *t) { assert(t); @@ -836,8 +834,7 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = { [UNIT_STUB] = "stub", [UNIT_LOADED] = "loaded", diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h index 2c56d12a2..0d0831115 100644 --- a/src/basic/unit-name.h +++ b/src/basic/unit-name.h @@ -44,8 +44,7 @@ typedef enum UnitType { _UNIT_TYPE_INVALID = -1 } UnitType; -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind typedef enum UnitLoadState { UNIT_STUB = 0, UNIT_LOADED, @@ -275,8 +274,7 @@ bool unit_prefix_is_valid(const char *p) _pure_; bool unit_instance_is_valid(const char *i) _pure_; bool unit_suffix_is_valid(const char *s) _pure_; -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind static inline int unit_prefix_and_instance_is_valid(const char *p) { /* For prefix+instance and instance the same rules apply */ return unit_instance_is_valid(p); @@ -293,8 +291,7 @@ int unit_name_change_suffix(const char *n, const char *suffix, char **ret); int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char *unit_name_escape(const char *f); int unit_name_unescape(const char *f, char **ret); int unit_name_path_escape(const char *f, char **ret); @@ -333,8 +330,7 @@ bool slice_name_is_valid(const char *name); const char *unit_type_to_string(UnitType i) _const_; UnitType unit_type_from_string(const char *s) _pure_; -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind const char *unit_load_state_to_string(UnitLoadState i) _const_; UnitLoadState unit_load_state_from_string(const char *s) _pure_; diff --git a/src/basic/user-util.c b/src/basic/user-util.c index 97ff2af4a..e1ab313bf 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -67,8 +67,7 @@ int parse_uid(const char *s, uid_t *ret) { return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char* getlogname_malloc(void) { uid_t uid; struct stat st; @@ -286,8 +285,7 @@ char* gid_to_name(gid_t gid) { return ret; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int in_gid(gid_t gid) { gid_t *gids; int ngroups_max, r, i; @@ -437,8 +435,7 @@ int reset_uid_gid(void) { return 0; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int take_etc_passwd_lock(const char *root) { struct flock flock = { diff --git a/src/basic/user-util.h b/src/basic/user-util.h index 235d0769a..4f098d085 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -36,8 +36,7 @@ static inline int parse_gid(const char *s, gid_t *ret_gid) { return parse_uid(s, (uid_t*) ret_gid); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind char* getlogname_malloc(void); char* getusername_malloc(void); #endif // 0 @@ -48,8 +47,7 @@ int get_group_creds(const char **groupname, gid_t *gid); char* uid_to_name(uid_t uid); char* gid_to_name(gid_t gid); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int in_gid(gid_t gid); int in_group(const char *name); @@ -59,8 +57,7 @@ int get_shell(char **_ret); int reset_uid_gid(void); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int take_etc_passwd_lock(const char *root); #endif // 0 diff --git a/src/basic/virt.c b/src/basic/virt.c index ca4a051cf..7c0666cc2 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -409,8 +409,7 @@ finish: return r; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int detect_virtualization(void) { int r; diff --git a/src/basic/virt.h b/src/basic/virt.h index 17e7310ac..feb47d50e 100644 --- a/src/basic/virt.h +++ b/src/basic/virt.h @@ -66,8 +66,7 @@ static inline bool VIRTUALIZATION_IS_CONTAINER(int x) { int detect_vm(void); int detect_container(void); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int detect_virtualization(void); #endif // 0 diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c index d440b3cd0..e00f1819d 100644 --- a/src/basic/xattr-util.c +++ b/src/basic/xattr-util.c @@ -98,8 +98,7 @@ int fgetxattr_malloc(int fd, const char *name, char **value) { } } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) { char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1]; _cleanup_close_ int fd = -1; diff --git a/src/basic/xattr-util.h b/src/basic/xattr-util.h index c535b4a0c..5ee598f15 100644 --- a/src/basic/xattr-util.h +++ b/src/basic/xattr-util.h @@ -29,8 +29,7 @@ int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink); int fgetxattr_malloc(int fd, const char *name, char **value); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags); int fd_setcrtime(int fd, usec_t usec); diff --git a/src/core/cgroup.c b/src/core/cgroup.c index b2d9d7f0a..a8d3ae36b 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -37,8 +37,7 @@ #define CGROUP_CPU_QUOTA_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC) -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind void cgroup_context_init(CGroupContext *c) { assert(c); @@ -1535,8 +1534,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) { m->cgroup_root = mfree(m->cgroup_root); } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind Unit* manager_get_unit_by_cgroup(Manager *m, const char *cgroup) { char *p; Unit *u; diff --git a/src/core/cgroup.h b/src/core/cgroup.h index 008588b68..732255689 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -27,8 +27,7 @@ // #include "time-util.h" #include "logind.h" -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind typedef struct CGroupContext CGroupContext; Stypedef struct CGroupDeviceAllow CGroupDeviceAllow; typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight; @@ -161,8 +160,7 @@ int unit_remove_from_netclass_cgroup(Unit *u); int manager_setup_cgroup(Manager *m); void manager_shutdown_cgroup(Manager *m, bool delete); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind unsigned manager_dispatch_cgroup_queue(Manager *m); Unit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup); -- 2.30.2