[systemd-devel] [PATCH 1/2] path: fix watching the root directory

Kay Sievers kay.sievers at vrfy.org
Wed Dec 1 07:57:44 PST 2010


On Wed, Dec 1, 2010 at 15:39, Michal Schmidt <mschmidt at redhat.com> wrote:
> If you have a path unit with:
>  DirectoryNotEmpty=/foo
> and "/foo" does not exist, creating it later escapes the attention of systemd.
>
> When adding watches for parent directories, systemd never adds one for the root
> directory. It attempts to add a watch for an empty string instead, which fails.
>
> If the path is "/", we must not trim the slash.

> +                /* Trim the path at the last slash. Keep the slash if it's the root dir. */
> +                slash[slash == k] = 0;

Awesome index logic :)

Applied.

Kay


More information about the systemd-devel mailing list