]> err.no Git - systemd/commitdiff
rename milestone to target
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Jan 2010 18:06:50 +0000 (19:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Jan 2010 18:06:50 +0000 (19:06 +0100)
12 files changed:
Makefile
fixme
load-fragment.c
main.c
milestone.c [deleted file]
milestone.h [deleted file]
name.c
name.h
target.c [new file with mode: 0644]
target.h [new file with mode: 0644]
test1/default.milestone [deleted file]
test1/default.target [new file with mode: 0644]

index ac815a1fe13f01c0bc0ff510367990f065b782ff..c473262effbf76c78393004067f118e6fa8a266f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ COMMON= \
        automount.o \
        mount.o \
        device.o \
-       milestone.o \
+       target.o \
        snapshot.o \
        socket.o \
        timer.o \
diff --git a/fixme b/fixme
index aa80b46ab401e8a3e522a42d2ec05bbb89e21f44..7e5f94363e8bec95b8e4c196496f59c8f9b2d54c 100644 (file)
--- a/fixme
+++ b/fixme
@@ -15,8 +15,6 @@
 
 - snapshot system
 
-- s/milestone/target/
-
 - hookup with battery status, suspend/resume
 
 - add a job mode which shuts everything down but what is requested
index aa1ae7867c069ee990d1c96bfee8a2a66a09ec7b..cf1e1498615fab6c5d39c92961e316a57eab6a32 100644 (file)
@@ -464,7 +464,7 @@ int name_load_fragment(Name *n) {
                 [NAME_SERVICE]   = "Service",
                 [NAME_TIMER]     = "Timer",
                 [NAME_SOCKET]    = "Socket",
-                [NAME_MILESTONE] = "Milestone",
+                [NAME_TARGET]    = "Target",
                 [NAME_DEVICE]    = "Device",
                 [NAME_MOUNT]     = "Mount",
                 [NAME_AUTOMOUNT] = "Automount",
diff --git a/main.c b/main.c
index e10c57b4457a113fd985b8d6c193ca5a50fec3f1..df15c559d49c5666187f81f2bf7d438bbd5534b8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -10,7 +10,7 @@
 
 int main(int argc, char *argv[]) {
         Manager *m = NULL;
-        Name *milestone = NULL, *syslog = NULL;
+        Name *target = NULL, *syslog = NULL;
         Job *job = NULL;
         int r, retval = 1;
 
@@ -21,8 +21,8 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        if ((r = manager_load_name(m, "default.milestone", &milestone)) < 0) {
-                log_error("Failed to load default milestone: %s", strerror(-r));
+        if ((r = manager_load_name(m, "default.target", &target)) < 0) {
+                log_error("Failed to load default target: %s", strerror(-r));
                 goto finish;
         }
 
@@ -31,8 +31,8 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        if ((r = manager_add_job(m, JOB_START, milestone, JOB_REPLACE, false, &job)) < 0) {
-                log_error("Failed to start default milestone: %s", strerror(-r));
+        if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &job)) < 0) {
+                log_error("Failed to start default target: %s", strerror(-r));
                 goto finish;
         }
 
diff --git a/milestone.c b/milestone.c
deleted file mode 100644 (file)
index fd4a689..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
-
-#include "name.h"
-#include "milestone.h"
-#include "load-fragment.h"
-
-static void milestone_done(Name *n) {
-        Milestone *m = MILESTONE(n);
-
-        assert(m);
-
-        /* Nothing here for now */
-}
-
-static NameActiveState milestone_active_state(Name *n) {
-        return MILESTONE(n)->state == MILESTONE_DEAD ? NAME_INACTIVE : NAME_ACTIVE;
-}
-
-const NameVTable milestone_vtable = {
-        .suffix = ".milestone",
-
-        .init = name_load_fragment,
-        .done = milestone_done,
-
-        .active_state = milestone_active_state
-};
diff --git a/milestone.h b/milestone.h
deleted file mode 100644 (file)
index 332fbe4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
-
-#ifndef foomilestonehfoo
-#define foomilestonehfoo
-
-typedef struct Milestone Milestone;
-
-#include "name.h"
-
-typedef enum MilestoneState {
-        MILESTONE_DEAD,
-        MILESTONE_ACTIVE
-} MilestoneState;
-
-struct Milestone {
-        Meta meta;
-
-        MilestoneState state;
-};
-
-extern const NameVTable milestone_vtable;
-
-#endif
diff --git a/name.c b/name.c
index 6352a8e3bb848ba6151820da144f320dcfb5539a..05eafab6b207bb162998a6237f0b5ac139904f0b 100644 (file)
--- a/name.c
+++ b/name.c
@@ -19,7 +19,7 @@ const NameVTable * const name_vtable[_NAME_TYPE_MAX] = {
         [NAME_SERVICE] = &service_vtable,
         [NAME_TIMER] = &timer_vtable,
         [NAME_SOCKET] = &socket_vtable,
-        [NAME_MILESTONE] = &milestone_vtable,
+        [NAME_TARGET] = &target_vtable,
         [NAME_DEVICE] = &device_vtable,
         [NAME_MOUNT] = &mount_vtable,
         [NAME_AUTOMOUNT] = &automount_vtable,
diff --git a/name.h b/name.h
index 8a4c1744f4bcf2ba6b176bf4a2d29d74ce2acee6..17bb35d6a74e197c5ccba3aca693007421c81c24 100644 (file)
--- a/name.h
+++ b/name.h
@@ -31,7 +31,7 @@ enum NameType {
         NAME_SERVICE = 0,
         NAME_TIMER,
         NAME_SOCKET,
-        NAME_MILESTONE,
+        NAME_TARGET,
         NAME_DEVICE,
         NAME_MOUNT,
         NAME_AUTOMOUNT,
@@ -121,7 +121,7 @@ struct Meta {
 #include "service.h"
 #include "timer.h"
 #include "socket.h"
-#include "milestone.h"
+#include "target.h"
 #include "device.h"
 #include "mount.h"
 #include "automount.h"
@@ -132,7 +132,7 @@ union Name {
         Service service;
         Timer timer;
         Socket socket;
-        Milestone milestone;
+        Target target;
         Device device;
         Mount mount;
         Automount automount;
@@ -184,7 +184,7 @@ extern const NameVTable * const name_vtable[_NAME_TYPE_MAX];
 DEFINE_CAST(SOCKET, Socket);
 DEFINE_CAST(TIMER, Timer);
 DEFINE_CAST(SERVICE, Service);
-DEFINE_CAST(MILESTONE, Milestone);
+DEFINE_CAST(TARGET, Target);
 DEFINE_CAST(DEVICE, Device);
 DEFINE_CAST(MOUNT, Mount);
 DEFINE_CAST(AUTOMOUNT, Automount);
diff --git a/target.c b/target.c
new file mode 100644 (file)
index 0000000..12a2192
--- /dev/null
+++ b/target.c
@@ -0,0 +1,26 @@
+/*-*- Mode: C; c-basic-offset: 8 -*-*/
+
+#include "name.h"
+#include "target.h"
+#include "load-fragment.h"
+
+static void target_done(Name *n) {
+        Target *m = TARGET(n);
+
+        assert(m);
+
+        /* Nothing here for now */
+}
+
+static NameActiveState target_active_state(Name *n) {
+        return TARGET(n)->state == TARGET_DEAD ? NAME_INACTIVE : NAME_ACTIVE;
+}
+
+const NameVTable target_vtable = {
+        .suffix = ".target",
+
+        .init = name_load_fragment,
+        .done = target_done,
+
+        .active_state = target_active_state
+};
diff --git a/target.h b/target.h
new file mode 100644 (file)
index 0000000..61f2803
--- /dev/null
+++ b/target.h
@@ -0,0 +1,23 @@
+/*-*- Mode: C; c-basic-offset: 8 -*-*/
+
+#ifndef footargethfoo
+#define footargethfoo
+
+typedef struct Target Target;
+
+#include "name.h"
+
+typedef enum TargetState {
+        TARGET_DEAD,
+        TARGET_ACTIVE
+} TargetState;
+
+struct Target {
+        Meta meta;
+
+        TargetState state;
+};
+
+extern const NameVTable target_vtable;
+
+#endif
diff --git a/test1/default.milestone b/test1/default.milestone
deleted file mode 100644 (file)
index c20a10e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[Meta]
-Names=multiuser.milestone
-Wants=postfix.socket syslog.socket
-Description=Default Milestone
diff --git a/test1/default.target b/test1/default.target
new file mode 100644 (file)
index 0000000..b158a23
--- /dev/null
@@ -0,0 +1,4 @@
+[Meta]
+Names=multiuser.target
+Wants=postfix.socket syslog.socket
+Description=Default Target