]> err.no Git - systemd/commitdiff
path: add missing pieces for PathModified
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 8 Dec 2011 11:09:10 +0000 (12:09 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 8 Dec 2011 17:45:38 +0000 (18:45 +0100)
PATH_MODIFIED worked internally for PID files detection, but was unusable
in units.

src/load-fragment-gperf.gperf.m4
src/path.c

index 84ae28ca38d2f6536cbed87c92c2618462c88567..35ec00557e24a3f8617adef64cfa663f056cc09f 100644 (file)
@@ -210,6 +210,7 @@ m4_dnl
 Path.PathExists,                 config_parse_path_spec,             0,                             0
 Path.PathExistsGlob,             config_parse_path_spec,             0,                             0
 Path.PathChanged,                config_parse_path_spec,             0,                             0
+Path.PathModified,               config_parse_path_spec,             0,                             0
 Path.DirectoryNotEmpty,          config_parse_path_spec,             0,                             0
 Path.Unit,                       config_parse_path_unit,             0,                             0
 Path.MakeDirectory,              config_parse_bool,                  0,                             offsetof(Path, make_directory)
index 1e5d8252090e7f11e9d3085a3355caf78a2d5baa..3fee24760c962b757fd025073361e66fc1ca9f17 100644 (file)
@@ -149,7 +149,8 @@ int pathspec_fd_event(PathSpec *s, uint32_t events) {
         while (k > 0) {
                 size_t step;
 
-                if (s->type == PATH_CHANGED && s->primary_wd == e->wd)
+                if ((s->type == PATH_CHANGED || s->type == PATH_MODIFIED) &&
+                    s->primary_wd == e->wd)
                         r = 1;
 
                 step = sizeof(struct inotify_event) + e->len;
@@ -184,7 +185,8 @@ static bool pathspec_check_good(PathSpec *s, bool initial) {
                 break;
         }
 
-        case PATH_CHANGED: {
+        case PATH_CHANGED:
+        case PATH_MODIFIED: {
                 bool b;
 
                 b = access(s->path, F_OK) >= 0;