]> err.no Git - systemd/commitdiff
path: add PathModified (= PathChanged + IN_MODIFY)
authorMichal Schmidt <mschmidt@redhat.com>
Sat, 3 Dec 2011 09:22:26 +0000 (10:22 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Sat, 3 Dec 2011 12:58:21 +0000 (13:58 +0100)
man/systemd.path.xml
src/path.c
src/path.h

index 10d8f7300475ea421b1c0ee3002d5c93602aa960..5b1ff75f7ae68a9c0324a7181c176c347152af05 100644 (file)
                                 <term><varname>PathExists=</varname></term>
                                 <term><varname>PathExistsGlob=</varname></term>
                                 <term><varname>PathChanged=</varname></term>
+                                <term><varname>PathModified=</varname></term>
                                 <term><varname>DirectoryNotEmpty=</varname></term>
 
                                 <listitem><para>Defines paths to
                                 specified. <varname>PathChanged=</varname>
                                 may be used to watch a file or
                                 directory and activate the configured
-                                unit whenever it changes or is
-                                modified. <varname>DirectoryNotEmpty=</varname>
+                                unit whenever it changes. It is not activated
+                                on every write to the watched file but it is
+                                activated if the file which was open for writing
+                                gets closed. <varname>PathModified=</varname>
+                                is similar, but additionally it is activated
+                                also on simple writes to the watched file.
+
+                                <varname>DirectoryNotEmpty=</varname>
                                 may be used to watch a directory and
                                 activate the configured unit whenever
                                 it contains at least one file.</para>
                                 activated, then the configured unit is
                                 immediately activated as
                                 well. Something similar does not apply
-                                to
-                                <varname>PathChanged=</varname>. The
-                                latter is not activated on simple
-                                writes but only if files with were
-                                opened for writing are closed.
+                                to <varname>PathChanged=</varname>.
                                 </para></listitem>
                         </varlistentry>
                         <varlistentry>
index db6f873dca408a189350a5bd132ee2ff29b37db0..1e5d8252090e7f11e9d3085a3355caf78a2d5baa 100644 (file)
@@ -44,6 +44,7 @@ int pathspec_watch(PathSpec *s, Unit *u) {
                 [PATH_EXISTS] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB,
                 [PATH_EXISTS_GLOB] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB,
                 [PATH_CHANGED] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVED_FROM|IN_MOVED_TO,
+                [PATH_MODIFIED] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVED_FROM|IN_MOVED_TO|IN_MODIFY,
                 [PATH_DIRECTORY_NOT_EMPTY] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CREATE|IN_MOVED_TO
         };
 
@@ -713,6 +714,7 @@ static const char* const path_type_table[_PATH_TYPE_MAX] = {
         [PATH_EXISTS] = "PathExists",
         [PATH_EXISTS_GLOB] = "PathExistsGlob",
         [PATH_CHANGED] = "PathChanged",
+        [PATH_MODIFIED] = "PathModified",
         [PATH_DIRECTORY_NOT_EMPTY] = "DirectoryNotEmpty"
 };
 
index 4e6ccf5b0eedc8ae09dc1312f96a4a94ef178870..1d78fe424ab7c944c7b0594415c55750310bb587 100644 (file)
@@ -41,6 +41,7 @@ typedef enum PathType {
         PATH_EXISTS_GLOB,
         PATH_DIRECTORY_NOT_EMPTY,
         PATH_CHANGED,
+        PATH_MODIFIED,
         _PATH_TYPE_MAX,
         _PATH_TYPE_INVALID = -1
 } PathType;