[systemd-commits] 4 commits - src/dbus-unit.c src/dbus-unit.h src/log.c src/log.h src/macro.h src/util.h

Michal Schmidt michich at kemper.freedesktop.org
Tue Jan 17 03:56:26 PST 2012


 src/dbus-unit.c |  160 ++++++++++++++++++++++++++++----------------------------
 src/dbus-unit.h |   19 ------
 src/log.c       |   25 ++++----
 src/log.h       |    7 --
 src/macro.h     |    8 --
 src/util.h      |    2 
 6 files changed, 97 insertions(+), 124 deletions(-)

New commits:
commit 281605bf141ce9e428577d57ed5204ec06755d8d
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Jan 17 12:50:42 2012 +0100

    util: fix ANSI sequence for red color
    
    Red turned green by mistake in commit c1072ea0.

diff --git a/src/util.h b/src/util.h
index 5413490..590dc17 100644
--- a/src/util.h
+++ b/src/util.h
@@ -70,7 +70,7 @@ typedef struct dual_timestamp {
 #define FORMAT_BYTES_MAX 8
 
 #define ANSI_HIGHLIGHT_ON "\x1B[1;39m"
-#define ANSI_HIGHLIGHT_RED_ON "\x1B[1;32m"
+#define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m"
 #define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m"
 #define ANSI_HIGHLIGHT_OFF "\x1B[0m"
 

commit b7f336383dc8ba58f720adb4c1d218348bf57e54
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Jan 17 12:05:33 2012 +0100

    log: make asserts cheaper
    
    On my x86_64 this shrinks the size of .text by 53 KB (7 %).

diff --git a/src/log.c b/src/log.c
index 04e90eb..f65e8d1 100644
--- a/src/log.c
+++ b/src/log.c
@@ -618,18 +618,13 @@ int log_meta(
         return r;
 }
 
-void log_assert(
-        const char*file,
-        int line,
-        const char *func,
-        const char *format, ...) {
-
+_noreturn_ static void log_assert(const char *text, const char *file, int line, const char *func, const char *format) {
         static char buffer[LINE_MAX];
-        va_list ap;
 
-        va_start(ap, format);
-        vsnprintf(buffer, sizeof(buffer), format, ap);
-        va_end(ap);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+        snprintf(buffer, sizeof(buffer), format, text, file, line, func);
+#pragma GCC diagnostic pop
 
         char_array_0(buffer);
         log_abort_msg = buffer;
@@ -638,6 +633,14 @@ void log_assert(
         abort();
 }
 
+void log_assert_failed(const char *text, const char *file, int line, const char *func) {
+        log_assert(text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
+}
+
+void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
+        log_assert(text, file, line, func, "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
+}
+
 int log_set_target_from_string(const char *e) {
         LogTarget t;
 
diff --git a/src/log.h b/src/log.h
index 6ab07a5..7028a13 100644
--- a/src/log.h
+++ b/src/log.h
@@ -73,11 +73,8 @@ int log_meta(
         const char *func,
         const char *format, ...) _printf_attr_(5,6);
 
-_noreturn_ void log_assert(
-        const char*file,
-        int line,
-        const char *func,
-        const char *format, ...) _printf_attr_(4,5);
+_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func);
+_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func);
 
 /* This modifies the buffer passed! */
 int log_dump_internal(
diff --git a/src/macro.h b/src/macro.h
index 3f30aa7..58de001 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -91,9 +91,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
 #define assert_se(expr)                                                 \
         do {                                                            \
                 if (_unlikely_(!(expr)))                                \
-                        log_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
-                                   "Assertion '%s' failed at %s:%u, function %s(). Aborting.", \
-                                   #expr , __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+                        log_assert_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
         } while (false)                                                 \
 
 /* We override the glibc assert() here. */
@@ -106,9 +104,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
 
 #define assert_not_reached(t)                                           \
         do {                                                            \
-                log_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__,     \
-                           "Code should not be reached '%s' at %s:%u, function %s(). Aborting.", \
-                           t, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+                log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
         } while (false)
 
 #define assert_cc(expr)                            \

commit 2b7dec8661029fd531b3818ca5a5470fa038751c
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Jan 17 10:21:30 2012 +0100

    log: remove useless variable
    
    abort() never returns. Not even if the signal handler catches SIGABRT.

diff --git a/src/log.c b/src/log.c
index 79c63a1..04e90eb 100644
--- a/src/log.c
+++ b/src/log.c
@@ -625,7 +625,6 @@ void log_assert(
         const char *format, ...) {
 
         static char buffer[LINE_MAX];
-        int saved_errno = errno;
         va_list ap;
 
         va_start(ap, format);
@@ -637,9 +636,6 @@ void log_assert(
 
         log_dispatch(LOG_CRIT, file, line, func, buffer);
         abort();
-
-        /* If the user chose to ignore this SIGABRT, we are happy to go on, as if nothing happened. */
-        errno = saved_errno;
 }
 
 int log_set_target_from_string(const char *e) {

commit e2110e5d1bf36b995efa62a9a05db5636ed05d46
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Jan 17 09:20:32 2012 +0100

    dbus-unit: make functions static
    
    The dbus_unit_append_*() functions are not referenced from outside anymore.

diff --git a/src/dbus-unit.c b/src/dbus-unit.c
index 9591c58..c7532c7 100644
--- a/src/dbus-unit.c
+++ b/src/dbus-unit.c
@@ -29,68 +29,6 @@
 
 const char bus_unit_interface[] _introspect_("Unit") = BUS_UNIT_INTERFACE;
 
-const BusProperty bus_unit_properties[] = {
-        { "Id",                   bus_property_append_string,         "s", offsetof(Unit, id),                                         true },
-        { "Names",                bus_unit_append_names,             "as", 0 },
-        { "Following",            bus_unit_append_following,          "s", 0 },
-        { "Requires",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRES]),                true },
-        { "RequiresOverridable",  bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRES_OVERRIDABLE]),    true },
-        { "Requisite",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE]),               true },
-        { "RequisiteOverridable", bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE_OVERRIDABLE]),   true },
-        { "Wants",                bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTS]),                   true },
-        { "BindTo",               bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BIND_TO]),                 true },
-        { "RequiredBy",           bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY]),             true },
-        { "RequiredByOverridable",bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY_OVERRIDABLE]), true },
-        { "WantedBy",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTED_BY]),               true },
-        { "BoundBy",              bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BOUND_BY]),                true },
-        { "Conflicts",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_CONFLICTS]),               true },
-        { "ConflictedBy",         bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_CONFLICTED_BY]),           true },
-        { "Before",               bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BEFORE]),                  true },
-        { "After",                bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_AFTER]),                   true },
-        { "OnFailure",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_ON_FAILURE]),              true },
-        { "Triggers",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERS]),                true },
-        { "TriggeredBy",          bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]),            true },
-        { "PropagateReloadTo",    bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_TO]),     true },
-        { "PropagateReloadFrom",  bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_FROM]),   true },
-        { "Description",          bus_unit_append_description,        "s", 0 },
-        { "LoadState",            bus_unit_append_load_state,         "s", offsetof(Unit, load_state)                         },
-        { "ActiveState",          bus_unit_append_active_state,       "s", 0 },
-        { "SubState",             bus_unit_append_sub_state,          "s", 0 },
-        { "FragmentPath",         bus_property_append_string,         "s", offsetof(Unit, fragment_path),                              true },
-        { "UnitFileState",        bus_unit_append_file_state,         "s", 0 },
-        { "InactiveExitTimestamp",bus_property_append_usec,           "t", offsetof(Unit, inactive_exit_timestamp.realtime)   },
-        { "InactiveExitTimestampMonotonic", bus_property_append_usec, "t", offsetof(Unit, inactive_exit_timestamp.monotonic)  },
-        { "ActiveEnterTimestamp", bus_property_append_usec,           "t", offsetof(Unit, active_enter_timestamp.realtime)    },
-        { "ActiveEnterTimestampMonotonic", bus_property_append_usec,  "t", offsetof(Unit, active_enter_timestamp.monotonic)   },
-        { "ActiveExitTimestamp",  bus_property_append_usec,           "t", offsetof(Unit, active_exit_timestamp.realtime)     },
-        { "ActiveExitTimestampMonotonic",  bus_property_append_usec,  "t", offsetof(Unit, active_exit_timestamp.monotonic)    },
-        { "InactiveEnterTimestamp", bus_property_append_usec,         "t", offsetof(Unit, inactive_enter_timestamp.realtime)  },
-        { "InactiveEnterTimestampMonotonic",bus_property_append_usec, "t", offsetof(Unit, inactive_enter_timestamp.monotonic) },
-        { "CanStart",             bus_unit_append_can_start,          "b", 0 },
-        { "CanStop",              bus_unit_append_can_stop,           "b", 0 },
-        { "CanReload",            bus_unit_append_can_reload,         "b", 0 },
-        { "CanIsolate",           bus_unit_append_can_isolate,        "b", 0 },
-        { "Job",                  bus_unit_append_job,             "(uo)", 0 },
-        { "StopWhenUnneeded",     bus_property_append_bool,           "b", offsetof(Unit, stop_when_unneeded)                 },
-        { "RefuseManualStart",    bus_property_append_bool,           "b", offsetof(Unit, refuse_manual_start)                },
-        { "RefuseManualStop",     bus_property_append_bool,           "b", offsetof(Unit, refuse_manual_stop)                 },
-        { "AllowIsolate",         bus_property_append_bool,           "b", offsetof(Unit, allow_isolate)                      },
-        { "DefaultDependencies",  bus_property_append_bool,           "b", offsetof(Unit, default_dependencies)               },
-        { "OnFailureIsolate",     bus_property_append_bool,           "b", offsetof(Unit, on_failure_isolate)                 },
-        { "IgnoreOnIsolate",      bus_property_append_bool,           "b", offsetof(Unit, ignore_on_isolate)                  },
-        { "IgnoreOnSnapshot",     bus_property_append_bool,           "b", offsetof(Unit, ignore_on_snapshot)                 },
-        { "DefaultControlGroup",  bus_unit_append_default_cgroup,     "s", 0 },
-        { "ControlGroup",         bus_unit_append_cgroups,           "as", 0 },
-        { "ControlGroupAttributes", bus_unit_append_cgroup_attrs,"a(sss)", 0 },
-        { "NeedDaemonReload",     bus_unit_append_need_daemon_reload, "b", 0 },
-        { "JobTimeoutUSec",       bus_property_append_usec,           "t", offsetof(Unit, job_timeout)                        },
-        { "ConditionTimestamp",   bus_property_append_usec,           "t", offsetof(Unit, condition_timestamp.realtime)       },
-        { "ConditionTimestampMonotonic", bus_property_append_usec,    "t", offsetof(Unit, condition_timestamp.monotonic)      },
-        { "ConditionResult",      bus_property_append_bool,           "b", offsetof(Unit, condition_result)                   },
-        { "LoadError",            bus_unit_append_load_error,      "(ss)", 0 },
-        { NULL, }
-};
-
 #define INVALIDATING_PROPERTIES                 \
         "LoadState\0"                           \
         "ActiveState\0"                         \
@@ -102,7 +40,7 @@ const BusProperty bus_unit_properties[] = {
         "Job\0"                                 \
         "NeedDaemonReload\0"
 
-int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data) {
         char *t;
         Iterator j;
         DBusMessageIter sub;
@@ -121,7 +59,7 @@ int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data)
         return 0;
 }
 
-int bus_unit_append_following(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_following(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data, *f;
         const char *d;
 
@@ -138,7 +76,7 @@ int bus_unit_append_following(DBusMessageIter *i, const char *property, void *da
         return 0;
 }
 
-int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, void *data) {
         Unit *u;
         Iterator j;
         DBusMessageIter sub;
@@ -157,7 +95,7 @@ int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, void
         return 0;
 }
 
-int bus_unit_append_description(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_description(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *d;
 
@@ -173,9 +111,9 @@ int bus_unit_append_description(DBusMessageIter *i, const char *property, void *
         return 0;
 }
 
-DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_load_state, unit_load_state, UnitLoadState);
+static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_load_state, unit_load_state, UnitLoadState);
 
-int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *state;
 
@@ -191,7 +129,7 @@ int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void
         return 0;
 }
 
-int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *state;
 
@@ -207,7 +145,7 @@ int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, void *da
         return 0;
 }
 
-int bus_unit_append_file_state(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_file_state(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *state;
 
@@ -223,7 +161,7 @@ int bus_unit_append_file_state(DBusMessageIter *i, const char *property, void *d
         return 0;
 }
 
-int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         dbus_bool_t b;
 
@@ -240,7 +178,7 @@ int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *da
         return 0;
 }
 
-int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         dbus_bool_t b;
 
@@ -260,7 +198,7 @@ int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void *dat
         return 0;
 }
 
-int bus_unit_append_can_reload(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_can_reload(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         dbus_bool_t b;
 
@@ -276,7 +214,7 @@ int bus_unit_append_can_reload(DBusMessageIter *i, const char *property, void *d
         return 0;
 }
 
-int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         dbus_bool_t b;
 
@@ -293,7 +231,7 @@ int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, void *
         return 0;
 }
 
-int bus_unit_append_job(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_job(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         DBusMessageIter sub;
         char *p;
@@ -340,7 +278,7 @@ int bus_unit_append_job(DBusMessageIter *i, const char *property, void *data) {
         return 0;
 }
 
-int bus_unit_append_default_cgroup(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_default_cgroup(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         char *t;
         CGroupBonding *cgb;
@@ -364,7 +302,7 @@ int bus_unit_append_default_cgroup(DBusMessageIter *i, const char *property, voi
         return success ? 0 : -ENOMEM;
 }
 
-int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         CGroupBonding *cgb;
         DBusMessageIter sub;
@@ -392,7 +330,7 @@ int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void *data
         return 0;
 }
 
-int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         CGroupAttribute *a;
         DBusMessageIter sub, sub2;
@@ -426,7 +364,7 @@ int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, void
         return 0;
 }
 
-int bus_unit_append_need_daemon_reload(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_need_daemon_reload(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         dbus_bool_t b;
 
@@ -442,7 +380,7 @@ int bus_unit_append_need_daemon_reload(DBusMessageIter *i, const char *property,
         return 0;
 }
 
-int bus_unit_append_load_error(DBusMessageIter *i, const char *property, void *data) {
+static int bus_unit_append_load_error(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *name, *message;
         DBusMessageIter sub;
@@ -848,3 +786,65 @@ oom:
 
         log_error("Failed to allocate unit remove signal.");
 }
+
+const BusProperty bus_unit_properties[] = {
+        { "Id",                   bus_property_append_string,         "s", offsetof(Unit, id),                                         true },
+        { "Names",                bus_unit_append_names,             "as", 0 },
+        { "Following",            bus_unit_append_following,          "s", 0 },
+        { "Requires",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRES]),                true },
+        { "RequiresOverridable",  bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRES_OVERRIDABLE]),    true },
+        { "Requisite",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE]),               true },
+        { "RequisiteOverridable", bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE_OVERRIDABLE]),   true },
+        { "Wants",                bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTS]),                   true },
+        { "BindTo",               bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BIND_TO]),                 true },
+        { "RequiredBy",           bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY]),             true },
+        { "RequiredByOverridable",bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY_OVERRIDABLE]), true },
+        { "WantedBy",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTED_BY]),               true },
+        { "BoundBy",              bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BOUND_BY]),                true },
+        { "Conflicts",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_CONFLICTS]),               true },
+        { "ConflictedBy",         bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_CONFLICTED_BY]),           true },
+        { "Before",               bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BEFORE]),                  true },
+        { "After",                bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_AFTER]),                   true },
+        { "OnFailure",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_ON_FAILURE]),              true },
+        { "Triggers",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERS]),                true },
+        { "TriggeredBy",          bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]),            true },
+        { "PropagateReloadTo",    bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_TO]),     true },
+        { "PropagateReloadFrom",  bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_FROM]),   true },
+        { "Description",          bus_unit_append_description,        "s", 0 },
+        { "LoadState",            bus_unit_append_load_state,         "s", offsetof(Unit, load_state)                         },
+        { "ActiveState",          bus_unit_append_active_state,       "s", 0 },
+        { "SubState",             bus_unit_append_sub_state,          "s", 0 },
+        { "FragmentPath",         bus_property_append_string,         "s", offsetof(Unit, fragment_path),                              true },
+        { "UnitFileState",        bus_unit_append_file_state,         "s", 0 },
+        { "InactiveExitTimestamp",bus_property_append_usec,           "t", offsetof(Unit, inactive_exit_timestamp.realtime)   },
+        { "InactiveExitTimestampMonotonic", bus_property_append_usec, "t", offsetof(Unit, inactive_exit_timestamp.monotonic)  },
+        { "ActiveEnterTimestamp", bus_property_append_usec,           "t", offsetof(Unit, active_enter_timestamp.realtime)    },
+        { "ActiveEnterTimestampMonotonic", bus_property_append_usec,  "t", offsetof(Unit, active_enter_timestamp.monotonic)   },
+        { "ActiveExitTimestamp",  bus_property_append_usec,           "t", offsetof(Unit, active_exit_timestamp.realtime)     },
+        { "ActiveExitTimestampMonotonic",  bus_property_append_usec,  "t", offsetof(Unit, active_exit_timestamp.monotonic)    },
+        { "InactiveEnterTimestamp", bus_property_append_usec,         "t", offsetof(Unit, inactive_enter_timestamp.realtime)  },
+        { "InactiveEnterTimestampMonotonic",bus_property_append_usec, "t", offsetof(Unit, inactive_enter_timestamp.monotonic) },
+        { "CanStart",             bus_unit_append_can_start,          "b", 0 },
+        { "CanStop",              bus_unit_append_can_stop,           "b", 0 },
+        { "CanReload",            bus_unit_append_can_reload,         "b", 0 },
+        { "CanIsolate",           bus_unit_append_can_isolate,        "b", 0 },
+        { "Job",                  bus_unit_append_job,             "(uo)", 0 },
+        { "StopWhenUnneeded",     bus_property_append_bool,           "b", offsetof(Unit, stop_when_unneeded)                 },
+        { "RefuseManualStart",    bus_property_append_bool,           "b", offsetof(Unit, refuse_manual_start)                },
+        { "RefuseManualStop",     bus_property_append_bool,           "b", offsetof(Unit, refuse_manual_stop)                 },
+        { "AllowIsolate",         bus_property_append_bool,           "b", offsetof(Unit, allow_isolate)                      },
+        { "DefaultDependencies",  bus_property_append_bool,           "b", offsetof(Unit, default_dependencies)               },
+        { "OnFailureIsolate",     bus_property_append_bool,           "b", offsetof(Unit, on_failure_isolate)                 },
+        { "IgnoreOnIsolate",      bus_property_append_bool,           "b", offsetof(Unit, ignore_on_isolate)                  },
+        { "IgnoreOnSnapshot",     bus_property_append_bool,           "b", offsetof(Unit, ignore_on_snapshot)                 },
+        { "DefaultControlGroup",  bus_unit_append_default_cgroup,     "s", 0 },
+        { "ControlGroup",         bus_unit_append_cgroups,           "as", 0 },
+        { "ControlGroupAttributes", bus_unit_append_cgroup_attrs,"a(sss)", 0 },
+        { "NeedDaemonReload",     bus_unit_append_need_daemon_reload, "b", 0 },
+        { "JobTimeoutUSec",       bus_property_append_usec,           "t", offsetof(Unit, job_timeout)                        },
+        { "ConditionTimestamp",   bus_property_append_usec,           "t", offsetof(Unit, condition_timestamp.realtime)       },
+        { "ConditionTimestampMonotonic", bus_property_append_usec,    "t", offsetof(Unit, condition_timestamp.monotonic)      },
+        { "ConditionResult",      bus_property_append_bool,           "b", offsetof(Unit, condition_result)                   },
+        { "LoadError",            bus_unit_append_load_error,      "(ss)", 0 },
+        { NULL, }
+};
diff --git a/src/dbus-unit.h b/src/dbus-unit.h
index 5ae9d0c..4f19a80 100644
--- a/src/dbus-unit.h
+++ b/src/dbus-unit.h
@@ -129,25 +129,6 @@
 
 extern const BusProperty bus_unit_properties[];
 
-int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_following(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_description(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_load_state(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_file_state(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_can_reload(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_job(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_default_cgroup(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_need_daemon_reload(DBusMessageIter *i, const char *property, void *data);
-int bus_unit_append_load_error(DBusMessageIter *i, const char *property, void *data);
-
 void bus_unit_send_change_signal(Unit *u);
 void bus_unit_send_removed_signal(Unit *u);
 



More information about the systemd-commits mailing list