[systemd-devel] [PATCH] [RFC] Add DropIn paths to status message

Lennart Poettering lennart at poettering.net
Fri Apr 5 09:27:58 PDT 2013


On Fri, 05.04.13 19:03, 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 )

Why the brackets? I think "," instead of ";" would be good enough. Also,
the "└─" should start right under the / of /home. And please use
"Drop-In" as spelling.

> +                                dd = strrchr(last_dir, '/');
> +
> +                                assert(dd);
> +
> +                                *dd = '\0';

Something to use path_get_file_name() for?

> +                } 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);

Still something where bus_parse_strv_iter() would be much nicer to use?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list