]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: when a unit's SourcePath points to API VFS pretend we are never out-of-date...
authorLennart Poettering <lennart@poettering.net>
Wed, 1 Mar 2017 15:25:08 +0000 (16:25 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Mar 2017 15:25:08 +0000 (10:25 -0500)
If the unit's SourcePath is below /proc then it's a unit genreated from
a kernel resource (such as a .mount or .swap unit). And those we watch
anyway, and hence should never be out-of-date.

Fixes: #5461
src/core/unit.c

index b091a0999b81bb1c65d53ba4dea01c9daa1f1c56..f76b6c30a83bed4c11b53f0a5a8986c0ff81809d 100644 (file)
@@ -3154,6 +3154,11 @@ static bool fragment_mtime_newer(const char *path, usec_t mtime, bool path_maske
         if (!path)
                 return false;
 
+        /* If the source is some virtual kernel file system, then we assume we watch it anyway, and hence pretend we
+         * are never out-of-date. */
+        if (PATH_STARTSWITH_SET(path, "/proc", "/sys"))
+                return false;
+
         if (stat(path, &st) < 0)
                 /* What, cannot access this anymore? */
                 return true;