X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fpath.c;h=e3defeb5abca6bc769cb67acbaf97d6b56183875;hb=c53158818d8cdaf46b3f1b5299b9bda118a1043f;hp=42dd5da8e1c7ca401447a002a2fccdf9632864ac;hpb=bcbe497e5a73d889e8799f8a3680c303afede347;p=elogind.git diff --git a/src/core/path.c b/src/core/path.c index 42dd5da8e..e3defeb5a 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -73,14 +73,16 @@ int path_spec_watch(PathSpec *s, Unit *u) { goto fail; } - if ((s->primary_wd = inotify_add_watch(s->inotify_fd, k, flags_table[s->type])) >= 0) + s->primary_wd = inotify_add_watch(s->inotify_fd, k, flags_table[s->type]); + if (s->primary_wd >= 0) exists = true; do { int flags; /* This assumes the path was passed through path_kill_slashes()! */ - if (!(slash = strrchr(k, '/'))) + slash = strrchr(k, '/'); + if (!slash) break; /* Trim the path at the last slash. Keep the slash if it's the root dir. */