]> err.no Git - systemd/commitdiff
gc: remove a lot of unused code
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 21:19:04 +0000 (23:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 21:19:04 +0000 (23:19 +0200)
src/job.c
src/job.h
src/mount.c
src/mount.h
src/unit.c
src/unit.h
src/util.c
src/util.h

index c3b529e920fe44b3314c8dfb6ab921e4fd2c6394..d7082153de533e8bda5009bf11b561bfb5c39469 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -134,30 +134,6 @@ void job_dependency_free(JobDependency *l) {
         free(l);
 }
 
-void job_dependency_delete(Job *subject, Job *object, bool *matters) {
-        JobDependency *l;
-
-        assert(object);
-
-        LIST_FOREACH(object, l, object->object_list) {
-                assert(l->object == object);
-
-                if (l->subject == subject)
-                        break;
-        }
-
-        if (!l) {
-                if (matters)
-                        *matters = false;
-                return;
-        }
-
-        if (matters)
-                *matters = l->matters;
-
-        job_dependency_free(l);
-}
-
 void job_dump(Job *j, FILE*f, const char *prefix) {
         assert(j);
         assert(f);
index a69c4aaf1d55b65cfbb004b84ddf83074c3d5109..ce2bb0600b51feec7d8a26d8068a64c6d1596ef4 100644 (file)
--- a/src/job.h
+++ b/src/job.h
@@ -124,7 +124,6 @@ void job_dump(Job *j, FILE*f, const char *prefix);
 
 JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts);
 void job_dependency_free(JobDependency *l);
-void job_dependency_delete(Job *subject, Job *object, bool *matters);
 
 bool job_is_anchor(Job *j);
 
index 9a201f33eda61990af100a41d0f935d48668713f..38547f7294df3a23e9b23fa2253b925deb2415de 100644 (file)
@@ -1487,57 +1487,6 @@ void mount_fd_event(Manager *m, int events) {
         }
 }
 
-int mount_path_is_mounted(Manager *m, const char* path) {
-        char *t;
-        int r;
-
-        assert(m);
-        assert(path);
-
-        if (path[0] != '/')
-                return 1;
-
-        if (!(t = strdup(path)))
-                return -ENOMEM;
-
-        path_kill_slashes(t);
-
-        for (;;) {
-                char *e, *slash;
-                Unit *u;
-
-                if (!(e = unit_name_from_path(t, ".mount"))) {
-                        r = -ENOMEM;
-                        goto finish;
-                }
-
-                u = manager_get_unit(m, e);
-                free(e);
-
-                if (u &&
-                    (MOUNT(u)->from_etc_fstab || MOUNT(u)->from_fragment) &&
-                    MOUNT(u)->state != MOUNT_MOUNTED) {
-                        r = 0;
-                        goto finish;
-                }
-
-                assert_se(slash = strrchr(t, '/'));
-
-                if (slash == t) {
-                        r = 1;
-                        goto finish;
-                }
-
-                *slash = 0;
-        }
-
-        r = 1;
-
-finish:
-        free(t);
-        return r;
-}
-
 static void mount_reset_maintenance(Unit *u) {
         Mount *m = MOUNT(u);
 
index 56a7b12b26bce20266f0fca1bdb91ed04f6753de..226a1e2f5db5183dee4fbb915738f870b77a0c78 100644 (file)
@@ -99,8 +99,6 @@ extern const UnitVTable mount_vtable;
 
 void mount_fd_event(Manager *m, int events);
 
-int mount_path_is_mounted(Manager *m, const char* path);
-
 const char* mount_state_to_string(MountState i);
 MountState mount_state_from_string(const char *s);
 
index 3c2e974163e504c2617c5f3096cfa259ec8a3b50..59776c33e48e7a4def9382c68ff3175e72e162ee 100644 (file)
@@ -722,16 +722,6 @@ int unit_load_fragment_and_dropin_optional(Unit *u) {
         return 0;
 }
 
-/* Common implementation for multiple backends */
-int unit_load_nop(Unit *u) {
-        assert(u);
-
-        if (u->meta.load_state == UNIT_STUB)
-                u->meta.load_state = UNIT_LOADED;
-
-        return 0;
-}
-
 int unit_load(Unit *u) {
         int r;
 
@@ -2124,20 +2114,6 @@ Unit *unit_following(Unit *u) {
         return NULL;
 }
 
-static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
-        [UNIT_SERVICE] = "service",
-        [UNIT_TIMER] = "timer",
-        [UNIT_SOCKET] = "socket",
-        [UNIT_TARGET] = "target",
-        [UNIT_DEVICE] = "device",
-        [UNIT_MOUNT] = "mount",
-        [UNIT_AUTOMOUNT] = "automount",
-        [UNIT_SNAPSHOT] = "snapshot",
-        [UNIT_SWAP] = "swap"
-};
-
-DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType);
-
 static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
         [UNIT_STUB] = "stub",
         [UNIT_LOADED] = "loaded",
index e3ca8bbca6f6d014488dc0313ad2486d3a9f3ce2..a99d33ef07f4e5bea60eb532b47e9b56d33458f5 100644 (file)
@@ -420,7 +420,6 @@ Unit *unit_follow_merge(Unit *u);
 
 int unit_load_fragment_and_dropin(Unit *u);
 int unit_load_fragment_and_dropin_optional(Unit *u);
-int unit_load_nop(Unit *u);
 int unit_load(Unit *unit);
 
 const char *unit_description(Unit *u);
@@ -485,9 +484,6 @@ void unit_reset_maintenance(Unit *u);
 
 Unit *unit_following(Unit *u);
 
-const char *unit_type_to_string(UnitType i);
-UnitType unit_type_from_string(const char *s);
-
 const char *unit_load_state_to_string(UnitLoadState i);
 UnitLoadState unit_load_state_from_string(const char *s);
 
index 4e371d148e34759697fca5a3fbdaa45dcf5f9372..c4ff5aa575d4ea45d6b69cb42c1560354fef7acc 100644 (file)
@@ -2492,18 +2492,6 @@ char* gethostname_malloc(void) {
         return strdup(u.sysname);
 }
 
-int getmachineid_malloc(char **b) {
-        int r;
-
-        assert(b);
-
-        if ((r = read_one_line_file("/var/lib/dbus/machine-id", b)) < 0)
-                return r;
-
-        strstrip(*b);
-        return 0;
-}
-
 char* getlogname_malloc(void) {
         uid_t uid;
         long bufsize;
index b2a2925604dcac3cdaf355d98065da9870a788eb..21f47dc1694fd2b277af1dbdf1eb16af8a0ece88 100644 (file)
@@ -319,7 +319,6 @@ void sigset_add_many(sigset_t *ss, ...);
 char* gethostname_malloc(void);
 char* getlogname_malloc(void);
 int getttyname_malloc(char **r);
-int getmachineid_malloc(char **r);
 
 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);