summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-03-01 16:25:08 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-01 10:25:08 -0500
commit77969722aaef10d9dd8fc13569f9a6d45c1a577e (patch)
treef6d6cf6e2c4f4398772b0964b7b79cf9941795f5
parentecadd9b3fd394fd5fdef87cf9f1fb764b0bb83f0 (diff)
core: when a unit's SourcePath points to API VFS pretend we are never out-of-date (#5487)
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
-rw-r--r--src/core/unit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index b091a0999b..f76b6c30a8 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -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;