X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fcondition.c;h=5d44039e5d24cd07c3e94ad2e49f1a3629b88578;hb=3d9a412243035beeaaf3465a62065444a5adf21c;hp=3b246f1a64ed479fee757439abf60940617ebd25;hpb=d051610953754ce2b79d23b83c1d5c167defd5be;p=elogind.git diff --git a/src/core/condition.c b/src/core/condition.c index 3b246f1a6..5d44039e5 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;