tree-wide: remove unused functions

This commit is contained in:
Thomas Hindoe Paaboel Andersen
2015-10-19 21:45:00 +02:00
parent c8115977bf
commit b250ea2fd6
6 changed files with 0 additions and 139 deletions

View File

@@ -178,17 +178,6 @@ static int mac_selinux_access_init(sd_bus_error *error) {
}
#endif
void mac_selinux_access_free(void) {
#ifdef HAVE_SELINUX
if (!initialized)
return;
avc_destroy();
initialized = false;
#endif
}
/*
This function communicates with the kernel to check whether or not it should
allow the access.

View File

@@ -25,8 +25,6 @@
#include "bus-util.h"
#include "manager.h"
void mac_selinux_access_free(void);
int mac_selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error);
#ifdef HAVE_SELINUX

View File

@@ -2320,44 +2320,6 @@ int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDependency
return unit_add_two_dependencies(u, d, e, other, add_reference);
}
int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const char *name, const char *path, bool add_reference) {
_cleanup_free_ char *buf = NULL;
Unit *other;
int r;
assert(u);
assert(name || path);
r = resolve_template(u, name, path, &buf, &name);
if (r < 0)
return r;
r = manager_load_unit(u->manager, name, path, NULL, &other);
if (r < 0)
return r;
return unit_add_dependency(other, d, u, add_reference);
}
int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference) {
_cleanup_free_ char *buf = NULL;
Unit *other;
int r;
assert(u);
assert(name || path);
r = resolve_template(u, name, path, &buf, &name);
if (r < 0)
return r;
r = manager_load_unit(u->manager, name, path, NULL, &other);
if (r < 0)
return r;
return unit_add_two_dependencies(other, d, e, u, add_reference);
}
int set_unit_path(const char *p) {
/* This is mostly for debug purposes */
if (setenv("SYSTEMD_UNIT_PATH", p, 0) < 0)
@@ -3365,19 +3327,6 @@ static int unit_drop_in_dir(Unit *u, UnitSetPropertiesMode mode, bool transient,
return 0;
}
static int unit_drop_in_file(Unit *u, UnitSetPropertiesMode mode, const char *name, char **p, char **q) {
_cleanup_free_ char *dir = NULL;
int r;
assert(u);
r = unit_drop_in_dir(u, mode, u->transient, &dir);
if (r < 0)
return r;
return drop_in_file(dir, u->id, 50, name, p, q);
}
int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data) {
_cleanup_free_ char *dir = NULL, *p = NULL, *q = NULL;
@@ -3476,28 +3425,6 @@ int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const
return unit_write_drop_in_private(u, mode, name, p);
}
int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name) {
_cleanup_free_ char *p = NULL, *q = NULL;
int r;
assert(u);
if (!IN_SET(mode, UNIT_PERSISTENT, UNIT_RUNTIME))
return 0;
r = unit_drop_in_file(u, mode, name, &p, &q);
if (r < 0)
return r;
if (unlink(q) < 0)
r = errno == ENOENT ? 0 : -errno;
else
r = 1;
rmdir(p);
return r;
}
int unit_make_transient(Unit *u) {
assert(u);

View File

@@ -464,9 +464,6 @@ int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference);
int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference);
int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference);
int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference);
int unit_add_exec_dependencies(Unit *u, ExecContext *c);
int unit_choose_id(Unit *u, const char *name);
@@ -592,8 +589,6 @@ int unit_write_drop_in_format(Unit *u, UnitSetPropertiesMode mode, const char *n
int unit_write_drop_in_private(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data);
int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *format, ...) _printf_(4,5);
int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name);
int unit_kill_context(Unit *u, KillContext *c, KillOperation k, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
int unit_make_transient(Unit *u);

View File

@@ -135,8 +135,6 @@ int udev_queue_export_device_finished(struct udev_queue_export *udev_queue_expor
#define UTIL_NAME_SIZE 512
#define UTIL_LINE_SIZE 16384
#define UDEV_ALLOWED_CHARS_INPUT "/ $%?,"
ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size);
int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size);
int util_log_priority(const char *priority);
size_t util_path_encode(const char *src, char *dest, size_t size);
void util_remove_trailing_chars(char *path, char c);

View File

@@ -100,52 +100,6 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string,
return 0;
}
ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
{
char path[UTIL_PATH_SIZE];
char target[UTIL_PATH_SIZE];
ssize_t len;
const char *pos;
strscpyl(path, sizeof(path), syspath, "/", slink, NULL);
len = readlink(path, target, sizeof(target));
if (len <= 0 || len == (ssize_t)sizeof(target))
return -1;
target[len] = '\0';
pos = strrchr(target, '/');
if (pos == NULL)
return -1;
pos = &pos[1];
return strscpy(value, size, pos);
}
int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size)
{
char link_target[UTIL_PATH_SIZE];
ssize_t len;
int i;
int back;
char *base = NULL;
len = readlink(syspath, link_target, sizeof(link_target));
if (len <= 0 || len == (ssize_t)sizeof(link_target))
return -1;
link_target[len] = '\0';
for (back = 0; startswith(&link_target[back * 3], "../"); back++)
;
for (i = 0; i <= back; i++) {
base = strrchr(syspath, '/');
if (base == NULL)
return -EINVAL;
base[0] = '\0';
}
strscpyl(base, size - (base - syspath), "/", &link_target[back * 3], NULL);
return 0;
}
int util_log_priority(const char *priority)
{
char *endptr;