[systemd-devel] [PATCH] [RFC] Add DropIn paths to status message
Lennart Poettering
lennart at poettering.net
Fri Apr 5 08:38:05 PDT 2013
On Fri, 05.04.13 18:27, Oleksii Shevchuk (alxchk at gmail.com) wrote:
> > dctl status null.target
> null.target - NYAN
> Loaded: loaded (/home/alxchk/.config/systemd/user/null.target; disabled)
> DropIn: /home/alxchk/.config/systemd/user/null.target.d
> ├─descr.conf
> ├─install-1.conf
> └─install.conf
> /etc/systemd/user/null.target.d
> └─test.conf
Hmm, I'd really prefer if we could keep this shorter. I.e. I probably
would jus show the files as is, without trying to build a tree of
them...
> + } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRING && streq(name, "DropInPaths")) {
> +
> + DBusMessageIter sub;
> +
> + dbus_message_iter_recurse(iter, &sub);
> + while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) {
> + const char *s;
> + int r;
> +
> + dbus_message_iter_get_basic(&sub, &s);
> +
> + r = strv_extend(&i->dropin_paths, s);
> + if (r < 0)
> + return r;
> +
> + dbus_message_iter_next(&sub);
> + }
> +
Probably something where using bus_parse_strv_iter() makes the code
nicer?
Otherwise looks nicer.
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list