summaryrefslogtreecommitdiff
path: root/src/core/condition.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-22 01:59:11 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-22 01:59:11 +0200
commit3d9a412243035beeaaf3465a62065444a5adf21c (patch)
treeda4fbcd887a2baa3d514c33975a322226ba392ff /src/core/condition.c
parentd29b05a4619c000918cbb9f1b9661bc53659c0b2 (diff)
util: fix tty_is_vc_resolve() in a container where /sys/class/tty/console/active is misleading
Diffstat (limited to 'src/core/condition.c')
-rw-r--r--src/core/condition.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/condition.c b/src/core/condition.c
index 3b246f1a64..5d44039e5d 100644
--- a/src/core/condition.c
+++ b/src/core/condition.c
@@ -223,14 +223,8 @@ bool condition_test(Condition *c) {
case CONDITION_PATH_IS_MOUNT_POINT:
return (path_is_mount_point(c->parameter, true) > 0) == !c->negate;
- case CONDITION_PATH_IS_READ_WRITE: {
- struct statvfs st;
-
- if (statvfs(c->parameter, &st) < 0)
- return c->negate;
-
- return !(st.f_flag & ST_RDONLY) == !c->negate;
- }
+ case CONDITION_PATH_IS_READ_WRITE:
+ return (path_is_read_only_fs(c->parameter) > 0) == c->negate;
case CONDITION_DIRECTORY_NOT_EMPTY: {
int k;