tree-wide: remove unused functions
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user