1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

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
This commit is contained in:
Lennart Poettering 2017-03-01 16:25:08 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent ecadd9b3fd
commit 77969722aa

View 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;