chiark / gitweb /
core: rename struct timestamp to dual_timestamp to avoid name clash with IP system...
authorLennart Poettering <lennart@poettering.net>
Wed, 30 Jun 2010 22:26:44 +0000 (00:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Jun 2010 22:26:44 +0000 (00:26 +0200)
src/dbus-unit.h
src/execute.c
src/execute.h
src/initctl.c
src/manager.c
src/manager.h
src/unit.c
src/unit.h
src/util.c
src/util.h

index 07641ee951676b289339aa511937330252853329..5662d305f283ea57bd124f55400441a8c52b6366 100644 (file)
         { "org.freedesktop.systemd1.Unit", "ActiveState",          bus_unit_append_active_state,   "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "SubState",             bus_unit_append_sub_state,      "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "FragmentPath",         bus_property_append_string,     "s",    u->meta.fragment_path             }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64,     "t",    &u->meta.inactive_exit_timestamp  }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64,     "t",    &u->meta.active_enter_timestamp   }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_uint64,     "t",    &u->meta.active_exit_timestamp    }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_uint64,    "t",    &u->meta.inactive_enter_timestamp }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64,     "t",    &u->meta.inactive_exit_timestamp.realtime  }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64,     "t",    &u->meta.active_enter_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_uint64,     "t",    &u->meta.active_exit_timestamp.realtime    }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_uint64,    "t",    &u->meta.inactive_enter_timestamp.realtime }, \
         { "org.freedesktop.systemd1.Unit", "CanStart",             bus_unit_append_can_start,      "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanReload",            bus_unit_append_can_reload,     "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Job",                  bus_unit_append_job,            "(uo)", u                                 }, \
index d5bb8d3602920510e3fdb4e46db6a6d544f9b612..cf71f232b421635c7705d019c2b3b788bef47f70 100644 (file)
@@ -1273,7 +1273,7 @@ int exec_spawn(ExecCommand *command,
         log_debug("Forked %s as %lu", command->path, (unsigned long) pid);
 
         command->exec_status.pid = pid;
-        command->exec_status.start_timestamp = now(CLOCK_REALTIME);
+        dual_timestamp_get(&command->exec_status.start_timestamp);
 
         *ret = pid;
         return 0;
@@ -1553,7 +1553,7 @@ void exec_status_fill(ExecStatus *s, pid_t pid, int code, int status) {
         assert(s);
 
         s->pid = pid;
-        s->exit_timestamp = now(CLOCK_REALTIME);
+        dual_timestamp_get(&s->exit_timestamp);
 
         s->code = code;
         s->status = status;
@@ -1575,17 +1575,17 @@ void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix) {
                 "%sPID: %lu\n",
                 prefix, (unsigned long) s->pid);
 
-        if (s->start_timestamp > 0)
+        if (s->start_timestamp.realtime > 0)
                 fprintf(f,
                         "%sStart Timestamp: %s\n",
-                        prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp));
+                        prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp.realtime));
 
-        if (s->exit_timestamp > 0)
+        if (s->exit_timestamp.realtime > 0)
                 fprintf(f,
                         "%sExit Timestamp: %s\n"
                         "%sExit Code: %s\n"
                         "%sExit Status: %i\n",
-                        prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp),
+                        prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp.realtime),
                         prefix, sigchld_code_to_string(s->code),
                         prefix, s->status);
 }
index e6180494977311f8a56f624083bbb97ac5ac2be3..841670aa6d6fe623737d96501575495f861b3224 100644 (file)
@@ -67,8 +67,8 @@ typedef enum ExecOutput {
 } ExecOutput;
 
 struct ExecStatus {
-        usec_t start_timestamp;
-        usec_t exit_timestamp;
+        dual_timestamp start_timestamp;
+        dual_timestamp exit_timestamp;
         pid_t pid;
         int code;     /* as in siginfo_t::si_code */
         int status;   /* as in sigingo_t::si_status */
index 3de7fcd42e89242b6dd1de24161bc6e91396ccde..a18cf384a473121dcc9064423684ff5b1173ca74 100644 (file)
@@ -290,7 +290,7 @@ static int server_init(Server *s, unsigned n_sockets) {
                         goto fail;
                 }
 
-                f->fd = SD_LISTEN_FDS_START+i;
+                f->fd = fd;
                 LIST_PREPEND(Fifo, fifo, s->fifos, f);
                 f->server = s;
                 s->n_fifos ++;
index f9763c838a2faab722fd6b0720579818931d31b7..b8daffd67b78164aa66255959920bb985391aa00 100644 (file)
@@ -194,7 +194,7 @@ int manager_new(ManagerRunningAs running_as, bool confirm_spawn, Manager **_m) {
         if (!(m = new0(Manager, 1)))
                 return -ENOMEM;
 
-        timestamp_get(&m->startup_timestamp);
+        dual_timestamp_get(&m->startup_timestamp);
 
         m->running_as = running_as;
         m->confirm_spawn = confirm_spawn;
index 6e74773f4d9e51cbbc6fb18137226a43e784d43e..eed137b10ab1d34effa6c61a8f7416f9af9117c2 100644 (file)
@@ -137,7 +137,7 @@ struct Manager {
 
         char **environment;
 
-        timestamp startup_timestamp;
+        dual_timestamp startup_timestamp;
 
         /* Data specific to the device subsystem */
         struct udev* udev;
index c546035ca1c83e3280d091b615f6fdfd897eb521..76e8cd74a0b5843788eb5f0067cbb6c040ae3a85 100644 (file)
@@ -926,7 +926,7 @@ static void retroactively_stop_dependencies(Unit *u) {
 
 void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
         bool unexpected = false;
-        timestamp ts;
+        dual_timestamp ts;
 
         assert(u);
         assert(os < _UNIT_ACTIVE_STATE_MAX);
@@ -939,7 +939,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
          * this function will be called too and the utmp code below
          * relies on that! */
 
-        timestamp_get(&ts);
+        dual_timestamp_get(&ts);
 
         if (os == UNIT_INACTIVE && ns != UNIT_INACTIVE)
                 u->meta.inactive_exit_timestamp = ts;
index fb158d511d398a7c36febc5fc67cf4c190f3f2d6..70b3c9a4c104985896bc5358c4b6124ea940b7f5 100644 (file)
@@ -153,10 +153,10 @@ struct Meta {
          * the job for it */
         Job *job;
 
-        timestamp inactive_exit_timestamp;
-        timestamp active_enter_timestamp;
-        timestamp active_exit_timestamp;
-        timestamp inactive_enter_timestamp;
+        dual_timestamp inactive_exit_timestamp;
+        dual_timestamp active_enter_timestamp;
+        dual_timestamp active_exit_timestamp;
+        dual_timestamp inactive_enter_timestamp;
 
         /* Counterparts in the cgroup filesystem */
         CGroupBonding *cgroup_bondings;
index 11ab074569ec422f5ecf9581ba94785e83c4a7e0..41d8e7f999eeaffaf695d06bcbeea22e34ca9531 100644 (file)
@@ -75,7 +75,7 @@ usec_t now(clockid_t clock_id) {
         return timespec_load(&ts);
 }
 
-timestamp* timestamp_get(timestamp *ts) {
+dual_timestamp* dual_timestamp_get(dual_timestamp *ts) {
         assert(ts);
 
         ts->realtime = now(CLOCK_REALTIME);
index 241031242121c21f46232c375269c248dd431e78..91e0359e0c15d612a5c4ac264e96cb29bc6d50fb 100644 (file)
 
 typedef uint64_t usec_t;
 
-typedef struct timestamp {
+typedef struct dual_timestamp {
         usec_t realtime;
         usec_t monotonic;
-} timestamp;
+} dual_timestamp;
 
 #define MSEC_PER_SEC  1000ULL
 #define USEC_PER_SEC  1000000ULL
@@ -60,7 +60,7 @@ typedef struct timestamp {
 
 usec_t now(clockid_t clock);
 
-timestamp* timestamp_get(timestamp *ts);
+dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
 
 usec_t timespec_load(const struct timespec *ts);
 struct timespec *timespec_store(struct timespec *ts, usec_t u);