[systemd-commits] man/systemd.unit.xml src/condition.c

Lennart Poettering lennart at kemper.freedesktop.org
Tue Sep 20 16:07:31 PDT 2011


 man/systemd.unit.xml |   12 ++++++------
 src/condition.c      |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 8571962ca31a468959eedce26fda278587327ba5
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Sep 21 01:07:25 2011 +0200

    condition: always follow symlinks for condition checks, to mimic test

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 4e2590d..4437510 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -691,7 +691,7 @@
                                 is prefixed with an exclamation mark
                                 (!), the test is negated, and the unit
                                 is only started if the path does not
-                                exist. The test follows symlinks.
+                                exist.
                                 <varname>ConditionPathExistsGlob=</varname>
                                 works in a similar way, but checks for
                                 the existence of at least one file or
@@ -701,9 +701,8 @@
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
-                                exists and is a directory. It does not
-                                follow
-                                symlinks. <varname>ConditionPathIsMountPoint=</varname>
+                                exists and is a
+                                directory. <varname>ConditionPathIsMountPoint=</varname>
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
@@ -713,7 +712,7 @@
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 exists, is a regular file and marked
-                                executable. It follows symlinks.
+                                executable.
                                 <varname>ConditionDirectoryNotEmpty=</varname>
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
@@ -781,7 +780,8 @@
                                 prefix an argument with the pipe
                                 symbol and an exclamation mark the
                                 pipe symbol must be passed first, the
-                                exclamation second.</para></listitem>
+                                exclamation second. All path checks
+                                follow symlinks.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
diff --git a/src/condition.c b/src/condition.c
index 131b456..7f85649 100644
--- a/src/condition.c
+++ b/src/condition.c
@@ -162,7 +162,7 @@ bool condition_test(Condition *c) {
         case CONDITION_PATH_IS_DIRECTORY: {
                 struct stat st;
 
-                if (lstat(c->parameter, &st) < 0)
+                if (stat(c->parameter, &st) < 0)
                         return !c->negate;
                 return S_ISDIR(st.st_mode) == !c->negate;
         }



More information about the systemd-commits mailing list