summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-04-07 09:40:54 +0200
committerSven Eden <yamakuzure@gmx.net>2017-04-26 12:59:13 +0200
commitbccdfb431a266e7671d518fd5a42362a5ce724c9 (patch)
treeb1d8366016677d6485660b3c8d1ea10977e3e8d7 /src
parent94c5f7fa9e34517edad75cd63d71dd459ec4f133 (diff)
Prep v228: Clean up the new src/basic/*-util-[hc] files:
- src/basic/capability-util.[hc] - src/basic/cgroup-util.[hc] - src/basic/fd-util.[hc] - src/basic/fs-util.[hc] - src/basic/memfd-util.[hc] - src/basic/path-util.[hc] - src/basic/socket-util.[hc] - src/basic/terminal-util.[hc] - src/basic/user-util.[hc] - src/basic/xattr-util.[hc]
Diffstat (limited to 'src')
-rw-r--r--src/basic/capability-util.c6
-rw-r--r--src/basic/capability-util.h13
-rw-r--r--src/basic/cgroup-util.h2
-rw-r--r--src/basic/fd-util.c6
-rw-r--r--src/basic/fd-util.h8
-rw-r--r--src/basic/fs-util.c9
-rw-r--r--src/basic/fs-util.h15
-rw-r--r--src/basic/memfd-util.c2
-rw-r--r--src/basic/memfd-util.h2
-rw-r--r--src/basic/path-util.c7
-rw-r--r--src/basic/path-util.h8
-rw-r--r--src/basic/socket-util.c12
-rw-r--r--src/basic/socket-util.h58
-rw-r--r--src/basic/terminal-util.c16
-rw-r--r--src/basic/terminal-util.h18
-rw-r--r--src/basic/user-util.c9
-rw-r--r--src/basic/user-util.h14
-rw-r--r--src/basic/xattr-util.c4
-rw-r--r--src/basic/xattr-util.h2
19 files changed, 132 insertions, 79 deletions
diff --git a/src/basic/capability-util.c b/src/basic/capability-util.c
index 0eb5c03d6..e261e4613 100644
--- a/src/basic/capability-util.c
+++ b/src/basic/capability-util.c
@@ -34,6 +34,8 @@
#include "parse-util.h"
#include "util.h"
+/// UNNEEDED by elogind
+#if 0
int have_effective_cap(int value) {
_cleanup_cap_free_ cap_t cap;
cap_flag_value_t fv;
@@ -47,6 +49,7 @@ int have_effective_cap(int value) {
else
return fv == CAP_SET;
}
+#endif // 0
unsigned long cap_last_cap(void) {
static thread_local unsigned long saved;
@@ -95,6 +98,8 @@ unsigned long cap_last_cap(void) {
return p;
}
+/// UNNEEDED by elogind
+#if 0
int capability_bounding_set_drop(uint64_t drop, bool right_now) {
_cleanup_cap_free_ cap_t after_cap = NULL;
cap_flag_value_t fv;
@@ -305,3 +310,4 @@ int drop_capability(cap_value_t cv) {
return 0;
}
+#endif // 0
diff --git a/src/basic/capability-util.h b/src/basic/capability-util.h
index 4eb5c2a83..3f6c988f6 100644
--- a/src/basic/capability-util.h
+++ b/src/basic/capability-util.h
@@ -27,14 +27,16 @@
#include "util.h"
unsigned long cap_last_cap(void);
-int have_effective_cap(int value);
-int capability_bounding_set_drop(uint64_t drop, bool right_now);
-int capability_bounding_set_drop_usermode(uint64_t drop);
+// UNNEEDED int have_effective_cap(int value);
+// UNNEEDED int capability_bounding_set_drop(uint64_t drop, bool right_now);
+// UNNEEDED int capability_bounding_set_drop_usermode(uint64_t drop);
-int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
+// UNNEEDED int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
-int drop_capability(cap_value_t cv);
+// UNNEEDED int drop_capability(cap_value_t cv);
+/// UNNEEDED by elogind
+#if 0
DEFINE_TRIVIAL_CLEANUP_FUNC(cap_t, cap_free);
#define _cleanup_cap_free_ _cleanup_(cap_freep)
@@ -43,3 +45,4 @@ static inline void cap_free_charpp(char **p) {
cap_free(*p);
}
#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp)
+#endif // 0
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index e3f3bf080..b82f2a896 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -166,7 +166,7 @@ bool cg_controller_is_valid(const char *p);
// UNNEEDED int cg_slice_to_path(const char *unit, char **ret);
-typedef const char* (*cg_migrate_callback_t)(CGroupMask mask, void *userdata);
+// UNNEEDED typedef const char* (*cg_migrate_callback_t)(CGroupMask mask, void *userdata);
// UNNEEDED int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path);
// UNNEEDED int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata);
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c
index d1b1db3a4..8b7065fd5 100644
--- a/src/basic/fd-util.c
+++ b/src/basic/fd-util.c
@@ -120,6 +120,8 @@ FILE* safe_fclose(FILE *f) {
return NULL;
}
+/// UNNEEDED by elogind
+#if 0
DIR* safe_closedir(DIR *d) {
if (d) {
@@ -130,6 +132,7 @@ DIR* safe_closedir(DIR *d) {
return NULL;
}
+#endif // 0
int fd_nonblock(int fd, bool nonblock) {
int flags, nflags;
@@ -248,6 +251,8 @@ int close_all_fds(const int except[], unsigned n_except) {
return r;
}
+/// UNNEEDED by elogind
+#if 0
int same_fd(int a, int b) {
struct stat sta, stb;
pid_t pid;
@@ -349,3 +354,4 @@ bool fdname_is_valid(const char *s) {
return p - s < 256;
}
+#endif // 0
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index 0e9182d75..0d742b50b 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -40,7 +40,7 @@ void close_many(const int fds[], unsigned n_fd);
int fclose_nointr(FILE *f);
FILE* safe_fclose(FILE *f);
-DIR* safe_closedir(DIR *f);
+// UNNEEDED DIR* safe_closedir(DIR *f);
static inline void closep(int *fd) {
safe_close(*fd);
@@ -68,8 +68,8 @@ int fd_cloexec(int fd, bool cloexec);
int close_all_fds(const int except[], unsigned n_except);
-int same_fd(int a, int b);
+// UNNEEDED int same_fd(int a, int b);
-void cmsg_close_all(struct msghdr *mh);
+// UNNEEDED void cmsg_close_all(struct msghdr *mh);
-bool fdname_is_valid(const char *s);
+// UNNEEDED bool fdname_is_valid(const char *s);
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
index a677fc571..9449e02a3 100644
--- a/src/basic/fs-util.c
+++ b/src/basic/fs-util.c
@@ -194,7 +194,6 @@ int readlink_value(const char *p, char **ret) {
return 0;
}
-#endif // 0
int readlink_and_make_absolute(const char *p, char **r) {
_cleanup_free_ char *target = NULL;
@@ -216,8 +215,6 @@ int readlink_and_make_absolute(const char *p, char **r) {
return 0;
}
-/// UNNEEDED by elogind
-#if 0
int readlink_and_canonicalize(const char *p, char **r) {
char *t, *s;
int j;
@@ -280,6 +277,8 @@ int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) {
assert(fd >= 0);
@@ -297,6 +296,7 @@ int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) {
return 0;
}
+#endif // 0
int fchmod_umask(int fd, mode_t m) {
mode_t u;
@@ -370,6 +370,8 @@ int touch(const char *path) {
return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
}
+/// UNNEEDED by elogind
+#if 0
int symlink_idempotent(const char *from, const char *to) {
_cleanup_free_ char *p = NULL;
int r;
@@ -455,6 +457,7 @@ int mkfifo_atomic(const char *path, mode_t mode) {
return 0;
}
+#endif // 0
int get_files_in_directory(const char *path, char ***list) {
_cleanup_closedir_ DIR *d = NULL;
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
index cc56fdf95..d36d2d6aa 100644
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -38,12 +38,12 @@ int unlink_noerrno(const char *path);
int readlinkat_malloc(int fd, const char *p, char **ret);
int readlink_malloc(const char *p, char **r);
// UNNEEDED int readlink_value(const char *p, char **ret);
-int readlink_and_make_absolute(const char *p, char **r);
+// UNNEEDED int readlink_and_make_absolute(const char *p, char **r);
// UNNEEDED int readlink_and_canonicalize(const char *p, char **r);
// UNNEEDED int readlink_and_make_absolute_root(const char *root, const char *path, char **ret);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
+// UNNEEDED int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
int fchmod_umask(int fd, mode_t mode);
@@ -54,14 +54,16 @@ int fd_warn_permissions(const char *path, int fd);
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);
-int symlink_idempotent(const char *from, const char *to);
+// UNNEEDED int symlink_idempotent(const char *from, const char *to);
-int symlink_atomic(const char *from, const char *to);
-int mknod_atomic(const char *path, mode_t mode, dev_t dev);
-int mkfifo_atomic(const char *path, mode_t mode);
+// UNNEEDED int symlink_atomic(const char *from, const char *to);
+// UNNEEDED int mknod_atomic(const char *path, mode_t mode, dev_t dev);
+// UNNEEDED int mkfifo_atomic(const char *path, mode_t mode);
int get_files_in_directory(const char *path, char ***list);
+/// UNNEEDED by elogind
+#if 0
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
@@ -73,3 +75,4 @@ union inotify_event_buffer {
struct inotify_event ev;
uint8_t raw[INOTIFY_EVENT_MAX];
};
+#endif // 0
diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c
index a9b11c507..e6eb1d45f 100644
--- a/src/basic/memfd-util.c
+++ b/src/basic/memfd-util.c
@@ -111,6 +111,8 @@ int memfd_set_sealed(int fd) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int memfd_get_sealed(int fd) {
int r;
diff --git a/src/basic/memfd-util.h b/src/basic/memfd-util.h
index 7d3fdd9c2..f2858beb8 100644
--- a/src/basic/memfd-util.h
+++ b/src/basic/memfd-util.h
@@ -30,7 +30,7 @@ int memfd_new(const char *name);
// UNNEEDED int memfd_map(int fd, uint64_t offset, size_t size, void **p);
int memfd_set_sealed(int fd);
-int memfd_get_sealed(int fd);
+// UNNEEDED int memfd_get_sealed(int fd);
// UNNEEDED int memfd_get_size(int fd, uint64_t *sz);
int memfd_set_size(int fd, uint64_t sz);
diff --git a/src/basic/path-util.c b/src/basic/path-util.c
index 3ebc5c536..fb23917dc 100644
--- a/src/basic/path-util.c
+++ b/src/basic/path-util.c
@@ -77,7 +77,6 @@ int path_split_and_make_absolute(const char *p, char ***ret) {
*ret = l;
return r;
}
-#endif // 0
char *path_make_absolute(const char *p, const char *prefix) {
assert(p);
@@ -90,6 +89,7 @@ char *path_make_absolute(const char *p, const char *prefix) {
return strjoin(prefix, "/", p, NULL);
}
+#endif // 0
int path_make_absolute_cwd(const char *p, char **ret) {
char *c;
@@ -647,7 +647,6 @@ char *prefix_root(const char *root, const char *path) {
strcpy(p, path);
return n;
}
-#endif // 0
int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg) {
char *p;
@@ -680,6 +679,7 @@ int parse_path_argument_and_warn(const char *path, bool suppress_root, char **ar
*arg = p;
return 0;
}
+#endif // 0
char* dirname_malloc(const char *path) {
char *d, *dir, *dir2;
@@ -802,6 +802,8 @@ bool hidden_file(const char *filename) {
return hidden_file_allow_backup(filename);
}
+/// UNNEEDED by elogind
+#if 0
bool is_device_path(const char *path) {
/* Returns true on paths that refer to a device, either in
@@ -811,3 +813,4 @@ bool is_device_path(const char *path) {
path_startswith(path, "/dev/") ||
path_startswith(path, "/sys/");
}
+#endif // 0
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 3295d62fa..3ef8eae68 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -38,7 +38,7 @@
bool is_path(const char *p) _pure_;
// UNNEEDED int path_split_and_make_absolute(const char *p, char ***ret);
bool path_is_absolute(const char *p) _pure_;
-char* path_make_absolute(const char *p, const char *prefix);
+// UNNEEDED char* path_make_absolute(const char *p, const char *prefix);
int path_make_absolute_cwd(const char *p, char **ret);
// UNNEEDED int path_make_relative(const char *from_dir, const char *to_path, char **_r);
char* path_kill_slashes(char *path);
@@ -57,7 +57,7 @@ char** path_strv_resolve_uniq(char **l, const char *prefix);
// UNNEEDED bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
// UNNEEDED int fsck_exists(const char *fstype);
-int mkfs_exists(const char *fstype);
+// UNNEEDED int mkfs_exists(const char *fstype);
/* Iterates through the path prefixes of the specified path, going up
* the tree, to root. Also returns "" (and not "/"!) for the root
@@ -96,7 +96,7 @@ int mkfs_exists(const char *fstype);
_ret; \
})
-int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg);
+// UNNEEDED int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg);
char* dirname_malloc(const char *path);
@@ -108,4 +108,4 @@ char *file_in_same_dir(const char *path, const char *filename);
bool hidden_file_allow_backup(const char *filename);
bool hidden_file(const char *filename) _pure_;
-bool is_device_path(const char *path);
+// UNNEEDED bool is_device_path(const char *path);
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 1acab1ef9..56a40a1de 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -44,6 +44,8 @@
#include "user-util.h"
#include "util.h"
+/// UNNEEDED by elogind
+#if 0
int socket_address_parse(SocketAddress *a, const char *s) {
char *e, *n;
unsigned u;
@@ -435,6 +437,7 @@ const char* socket_address_get_path(const SocketAddress *a) {
return a->sockaddr.un.sun_path;
}
+#endif // 0
bool socket_ipv6_is_supported(void) {
_cleanup_free_ char *l = NULL;
@@ -450,6 +453,8 @@ bool socket_ipv6_is_supported(void) {
return l[0] == '0';
}
+/// UNNEEDED by elogind
+#if 0
bool socket_address_matches_fd(const SocketAddress *a, int fd) {
SocketAddress b;
socklen_t solen;
@@ -755,6 +760,7 @@ bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b
return false;
}
+#endif // 0
int fd_inc_sndbuf(int fd, size_t n) {
int r, value;
@@ -791,6 +797,8 @@ int fd_inc_rcvbuf(int fd, size_t n) {
return 1;
}
+/// UNNEEDED by elogind
+#if 0
static const char* const ip_tos_table[] = {
[IPTOS_LOWDELAY] = "low-delay",
[IPTOS_THROUGHPUT] = "throughput",
@@ -799,6 +807,7 @@ static const char* const ip_tos_table[] = {
};
DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(ip_tos, int, 0xff);
+#endif // 0
int getpeercred(int fd, struct ucred *ucred) {
socklen_t n = sizeof(struct ucred);
@@ -894,6 +903,8 @@ int send_one_fd(int transport_fd, int fd, int flags) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int receive_one_fd(int transport_fd, int flags) {
union {
struct cmsghdr cmsghdr;
@@ -935,3 +946,4 @@ int receive_one_fd(int transport_fd, int flags) {
return *(int*) CMSG_DATA(found);
}
+#endif // 0
diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h
index c60f2556a..4c9905494 100644
--- a/src/basic/socket-util.h
+++ b/src/basic/socket-util.h
@@ -41,6 +41,8 @@ union sockaddr_union {
struct sockaddr_ll ll;
};
+/// UNNEEDED by elogind
+#if 0
typedef struct SocketAddress {
union sockaddr_union sockaddr;
@@ -64,16 +66,19 @@ typedef enum SocketAddressBindIPv6Only {
} SocketAddressBindIPv6Only;
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)
+#endif // 0
-int socket_address_parse(SocketAddress *a, const char *s);
-int socket_address_parse_and_warn(SocketAddress *a, const char *s);
-int socket_address_parse_netlink(SocketAddress *a, const char *s);
-int socket_address_print(const SocketAddress *a, char **p);
-int socket_address_verify(const SocketAddress *a) _pure_;
-int socket_address_unlink(SocketAddress *a);
+// UNNEEDED int socket_address_parse(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_parse_and_warn(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_parse_netlink(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_print(const SocketAddress *a, char **p);
+// UNNEEDED int socket_address_verify(const SocketAddress *a) _pure_;
+// UNNEEDED int socket_address_unlink(SocketAddress *a);
-bool socket_address_can_accept(const SocketAddress *a) _pure_;
+// UNNEEDED bool socket_address_can_accept(const SocketAddress *a) _pure_;
+/// UNNEEDED by elogind
+#if 0
int socket_address_listen(
const SocketAddress *a,
int flags,
@@ -87,46 +92,47 @@ int socket_address_listen(
mode_t socket_mode,
const char *label);
int make_socket_fd(int log_level, const char* address, int flags);
+#endif // 0
-bool socket_address_is(const SocketAddress *a, const char *s, int type);
-bool socket_address_is_netlink(const SocketAddress *a, const char *s);
+// UNNEEDED bool socket_address_is(const SocketAddress *a, const char *s, int type);
+// UNNEEDED bool socket_address_is_netlink(const SocketAddress *a, const char *s);
-bool socket_address_matches_fd(const SocketAddress *a, int fd);
+// UNNEEDED bool socket_address_matches_fd(const SocketAddress *a, int fd);
-bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
+// UNNEEDED bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
-const char* socket_address_get_path(const SocketAddress *a);
+// UNNEEDED const char* socket_address_get_path(const SocketAddress *a);
bool socket_ipv6_is_supported(void);
-int sockaddr_port(const struct sockaddr *_sa) _pure_;
+// UNNEEDED int sockaddr_port(const struct sockaddr *_sa) _pure_;
-int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
-int getpeername_pretty(int fd, char **ret);
-int getsockname_pretty(int fd, char **ret);
+// UNNEEDED Sint sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
+// UNNEEDED int getpeername_pretty(int fd, char **ret);
+// UNNEEDED int getsockname_pretty(int fd, char **ret);
-int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret);
-int getnameinfo_pretty(int fd, char **ret);
+// UNNEEDED int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret);
+// UNNEEDED int getnameinfo_pretty(int fd, char **ret);
-const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_;
-SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_;
+// UNNEEDED const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_;
+// UNNEEDED SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_;
-int netlink_family_to_string_alloc(int b, char **s);
-int netlink_family_from_string(const char *s) _pure_;
+// UNNEEDED int netlink_family_to_string_alloc(int b, char **s);
+// UNNEEDED int netlink_family_from_string(const char *s) _pure_;
-bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b);
+// UNNEEDED 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);
-int ip_tos_to_string_alloc(int i, char **s);
-int ip_tos_from_string(const char *s);
+// UNNEEDED int ip_tos_to_string_alloc(int i, char **s);
+// UNNEEDED int ip_tos_from_string(const char *s);
int getpeercred(int fd, struct ucred *ucred);
int getpeersec(int fd, char **ret);
int send_one_fd(int transport_fd, int fd, int flags);
-int receive_one_fd(int transport_fd, int flags);
+// UNNEEDED int receive_one_fd(int transport_fd, int flags);
#define CMSG_FOREACH(cmsg, mh) \
for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg)))
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index 20c4df74d..d34f61e1c 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -74,6 +74,8 @@ int chvt(int vt) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
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];
@@ -134,8 +136,6 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
return 0;
}
-/// UNNEEDED by elogind
-#if 0
int ask_char(char *ret, const char *replies, const char *text, ...) {
int r;
@@ -226,7 +226,6 @@ int ask_string(char **ret, const char *text, ...) {
}
}
}
-#endif // 0
int reset_terminal_fd(int fd, bool switch_to_text) {
struct termios termios;
@@ -305,6 +304,7 @@ int reset_terminal(const char *name) {
return reset_terminal_fd(fd, true);
}
+#endif // 0
int open_terminal(const char *name, int mode) {
int fd, r;
@@ -352,6 +352,8 @@ int open_terminal(const char *name, int mode) {
return fd;
}
+/// UNNEEDED by elogind
+#if 0
int acquire_terminal(
const char *name,
bool fail,
@@ -499,6 +501,7 @@ fail:
return r;
}
+#endif // 0
/// UNNEEDED by elogind
#if 0
@@ -527,7 +530,6 @@ int release_terminal(void) {
return r;
}
-#endif // 0
int terminal_vhangup_fd(int fd) {
assert(fd >= 0);
@@ -614,8 +616,6 @@ int vt_disallocate(const char *name) {
return 0;
}
-/// UNNEEDED by elogind
-#if 0
int make_console_stdio(void) {
int fd, r;
@@ -676,6 +676,8 @@ int vtnr_from_tty(const char *tty) {
return i;
}
+/// UNNEEDED by elogind
+#if 0
char *resolve_dev_console(char **active) {
char *tty;
@@ -726,8 +728,6 @@ bool tty_is_vc_resolve(const char *tty) {
return tty_is_vc(tty);
}
-/// UNNEEDED by elogind
-#if 0
const char *default_term_for_tty(const char *tty) {
assert(tty);
diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h
index a5dffbfb5..36fc5d173 100644
--- a/src/basic/terminal-util.h
+++ b/src/basic/terminal-util.h
@@ -42,27 +42,27 @@
/* Set cursor to top left corner and clear screen */
#define ANSI_HOME_CLEAR "\x1B[H\x1B[2J"
-int reset_terminal_fd(int fd, bool switch_to_text);
-int reset_terminal(const char *name);
+// UNNEEDED int reset_terminal_fd(int fd, bool switch_to_text);
+// UNNEEDED int reset_terminal(const char *name);
int open_terminal(const char *name, int mode);
-int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
+// UNNEEDED int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
// UNNEEDED int release_terminal(void);
-int terminal_vhangup_fd(int fd);
-int terminal_vhangup(const char *name);
+// UNNEEDED int terminal_vhangup_fd(int fd);
+// UNNEEDED int terminal_vhangup(const char *name);
int chvt(int vt);
-int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
+// UNNEEDED int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
// UNNEEDED int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
// UNNEEDED int ask_string(char **ret, const char *text, ...) _printf_(2, 3);
-int vt_disallocate(const char *name);
+// UNNEEDED int vt_disallocate(const char *name);
-char *resolve_dev_console(char **active);
+// UNNEEDED char *resolve_dev_console(char **active);
bool tty_is_vc(const char *tty);
-bool tty_is_vc_resolve(const char *tty);
+// UNNEEDED bool tty_is_vc_resolve(const char *tty);
bool tty_is_console(const char *tty) _pure_;
int vtnr_from_tty(const char *tty);
// UNNEEDED const char *default_term_for_tty(const char *tty);
diff --git a/src/basic/user-util.c b/src/basic/user-util.c
index 397880b0b..97ff2af4a 100644
--- a/src/basic/user-util.c
+++ b/src/basic/user-util.c
@@ -67,6 +67,8 @@ int parse_uid(const char *s, uid_t *ret) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
char* getlogname_malloc(void) {
uid_t uid;
struct stat st;
@@ -88,6 +90,7 @@ char *getusername_malloc(void) {
return uid_to_name(getuid());
}
+#endif // 0
int get_user_creds(
const char **username,
@@ -283,6 +286,8 @@ char* gid_to_name(gid_t gid) {
return ret;
}
+/// UNNEEDED by elogind
+#if 0
int in_gid(gid_t gid) {
gid_t *gids;
int ngroups_max, r, i;
@@ -416,6 +421,7 @@ int get_shell(char **_s) {
*_s = s;
return 0;
}
+#endif // 0
int reset_uid_gid(void) {
@@ -431,6 +437,8 @@ int reset_uid_gid(void) {
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int take_etc_passwd_lock(const char *root) {
struct flock flock = {
@@ -470,3 +478,4 @@ int take_etc_passwd_lock(const char *root) {
return fd;
}
+#endif // 0
diff --git a/src/basic/user-util.h b/src/basic/user-util.h
index 11ff6674c..87200a28c 100644
--- a/src/basic/user-util.h
+++ b/src/basic/user-util.h
@@ -36,8 +36,8 @@ static inline int parse_gid(const char *s, gid_t *ret_gid) {
return parse_uid(s, (uid_t*) ret_gid);
}
-char* getlogname_malloc(void);
-char* getusername_malloc(void);
+// UNNEEDED char* getlogname_malloc(void);
+// UNNEEDED char* getusername_malloc(void);
int get_user_creds(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);
@@ -45,15 +45,15 @@ int get_group_creds(const char **groupname, gid_t *gid);
char* uid_to_name(uid_t uid);
char* gid_to_name(gid_t gid);
-int in_gid(gid_t gid);
-int in_group(const char *name);
+// UNNEEDED int in_gid(gid_t gid);
+// UNNEEDED int in_group(const char *name);
-int get_home_dir(char **ret);
-int get_shell(char **_ret);
+// UNNEEDED int get_home_dir(char **ret);
+// UNNEEDED int get_shell(char **_ret);
int reset_uid_gid(void);
-int take_etc_passwd_lock(const char *root);
+// UNNEEDED int take_etc_passwd_lock(const char *root);
#define UID_INVALID ((uid_t) -1)
#define GID_INVALID ((gid_t) -1)
diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c
index ddffd016b..d440b3cd0 100644
--- a/src/basic/xattr-util.c
+++ b/src/basic/xattr-util.c
@@ -98,6 +98,8 @@ int fgetxattr_malloc(int fd, const char *name, char **value) {
}
}
+/// UNNEEDED by elogind
+#if 0
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;
@@ -118,8 +120,6 @@ ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute,
return l;
}
-/// UNNEEDED by elogind
-#if 0
static int parse_crtime(le64_t le, usec_t *usec) {
uint64_t u;
diff --git a/src/basic/xattr-util.h b/src/basic/xattr-util.h
index 048e53bf7..e6833ef23 100644
--- a/src/basic/xattr-util.h
+++ b/src/basic/xattr-util.h
@@ -29,7 +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);
-ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags);
+// UNNEEDED ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags);
// UNNEEDED int fd_setcrtime(int fd, usec_t usec);