chiark / gitweb /
logind: support for hybrid sleep (i.e. suspend+hibernate at the same time)
[elogind.git] / src / core / path.c
index 42dd5da8e1c7ca401447a002a2fccdf9632864ac..3936971b41a63c5325fbe7ec62da05e15144d164 100644 (file)
@@ -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. */
@@ -314,7 +316,7 @@ static int path_add_default_dependencies(Path *p) {
 
         assert(p);
 
-        if (UNIT(p)->manager->running_as == MANAGER_SYSTEM) {
+        if (UNIT(p)->manager->running_as == SYSTEMD_SYSTEM) {
                 if ((r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0)
                         return r;