[systemd-commits] 2 commits - TODO src/core src/shared src/systemctl
Lennart Poettering
lennart at kemper.freedesktop.org
Thu May 3 14:10:39 PDT 2012
TODO | 6 ++----
src/core/dbus-job.c | 2 ++
src/core/dbus-manager.c | 2 ++
src/shared/dbus-common.h | 9 ++++++---
src/systemctl/systemctl.c | 30 +++++++++++++++++++++++++-----
5 files changed, 37 insertions(+), 12 deletions(-)
New commits:
commit 6e476bc9d18c706564d797882df6a27ab2d45b8b
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu May 3 23:06:19 2012 +0200
dbus: handle invalid enum values better
diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h
index 8598129..edb8107 100644
--- a/src/shared/dbus-common.h
+++ b/src/shared/dbus-common.h
@@ -155,7 +155,7 @@ int bus_property_set_uint64(DBusMessageIter *i, const char *property, void *data
assert(i); \
assert(property); \
\
- value = name##_to_string(*field); \
+ value = strempty(name##_to_string(*field)); \
\
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &value)) \
return -ENOMEM; \
@@ -166,15 +166,18 @@ int bus_property_set_uint64(DBusMessageIter *i, const char *property, void *data
#define DEFINE_BUS_PROPERTY_SET_ENUM(function,name,type) \
int function(DBusMessageIter *i, const char *property, void *data) { \
const char *value; \
- type *field = data; \
+ type f, *field = data; \
\
assert(i); \
assert(property); \
\
dbus_message_iter_get_basic(i, &value); \
\
- *field = name##_from_string(value); \
+ f = name##_from_string(value); \
+ if (f < 0) \
+ return f; \
\
+ *field = f; \
return 0; \
}
commit 06dab8e18aebf822392c7ca66c5bf3c1200fdec8
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu May 3 22:53:25 2012 +0200
dbus: include unit name in JobNew/JobRemoved signals
This breaks D-Bus interface slightly, but since the D-Bus API isn't
covered by the interface stability promise this should be OK.
diff --git a/TODO b/TODO
index 0810f37..2e33360 100644
--- a/TODO
+++ b/TODO
@@ -23,6 +23,8 @@ Bugfixes:
Features:
+* services which create their own subcgroups break cgroup-empty notification (needs to be fixed in the kernel)
+
* don't delete /tmp/systemd-namespace-* before a process is gone down
* don't delete /run/users/lennart if lennart is still logged in even if aging is used
@@ -31,10 +33,6 @@ Features:
* vconsole: implement setterm -store -foreground xxx --background zzz
-* taint flag for rtc-in-localtime
-
-* include unit name in D-Bus 'Job' signals
-
* ExecOnFailure=/usr/bin/foo
* logind: add "mode" flag to poweroff/suspend inhibit logic so that we can
diff --git a/src/core/dbus-job.c b/src/core/dbus-job.c
index 446f809..1b01ead 100644
--- a/src/core/dbus-job.c
+++ b/src/core/dbus-job.c
@@ -295,6 +295,7 @@ static DBusMessage* new_change_signal_message(Job *j) {
if (!dbus_message_append_args(m,
DBUS_TYPE_UINT32, &j->id,
DBUS_TYPE_OBJECT_PATH, &p,
+ DBUS_TYPE_STRING, &j->unit->id,
DBUS_TYPE_INVALID))
goto oom;
}
@@ -326,6 +327,7 @@ static DBusMessage* new_removed_signal_message(Job *j) {
if (!dbus_message_append_args(m,
DBUS_TYPE_UINT32, &j->id,
DBUS_TYPE_OBJECT_PATH, &p,
+ DBUS_TYPE_STRING, &j->unit->id,
DBUS_TYPE_STRING, &r,
DBUS_TYPE_INVALID))
goto oom;
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 6655f29..b5b5113 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -198,10 +198,12 @@
" <signal name=\"JobNew\">\n" \
" <arg name=\"id\" type=\"u\"/>\n" \
" <arg name=\"job\" type=\"o\"/>\n" \
+ " <arg name=\"unit\" type=\"s\"/>\n" \
" </signal>\n" \
" <signal name=\"JobRemoved\">\n" \
" <arg name=\"id\" type=\"u\"/>\n" \
" <arg name=\"job\" type=\"o\"/>\n" \
+ " <arg name=\"unit\" type=\"s\"/>\n" \
" <arg name=\"result\" type=\"s\"/>\n" \
" </signal>" \
" <signal name=\"StartupFinished\">\n" \
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 681ad8c..d80eb94 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1349,18 +1349,19 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
} else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobRemoved")) {
uint32_t id;
- const char *path, *result;
+ const char *path, *result, *unit;
dbus_bool_t success = true;
if (dbus_message_get_args(message, &error,
DBUS_TYPE_UINT32, &id,
DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_STRING, &unit,
DBUS_TYPE_STRING, &result,
DBUS_TYPE_INVALID)) {
char *p;
- if ((p = set_remove(d->set, (char*) path)))
- free(p);
+ p = set_remove(d->set, (char*) path);
+ free(p);
if (*result)
d->result = strdup(result);
@@ -1369,7 +1370,26 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
}
#ifndef LEGACY
dbus_error_free(&error);
+ if (dbus_message_get_args(message, &error,
+ DBUS_TYPE_UINT32, &id,
+ DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_STRING, &result,
+ DBUS_TYPE_INVALID)) {
+ char *p;
+
+ /* Compatibility with older systemd versions <
+ * 183 during upgrades. This should be dropped
+ * one day. */
+ p = set_remove(d->set, (char*) path);
+ free(p);
+ if (*result)
+ d->result = strdup(result);
+
+ goto finish;
+ }
+
+ dbus_error_free(&error);
if (dbus_message_get_args(message, &error,
DBUS_TYPE_UINT32, &id,
DBUS_TYPE_OBJECT_PATH, &path,
@@ -1381,8 +1401,8 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
* 19 during upgrades. This should be dropped
* one day */
- if ((p = set_remove(d->set, (char*) path)))
- free(p);
+ p = set_remove(d->set, (char*) path);
+ free(p);
if (!success)
d->result = strdup("failed");
More information about the systemd-commits
mailing list