summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-08-23 00:37:35 +0200
committerLennart Poettering <lennart@poettering.net>2011-08-23 00:37:35 +0200
commit0c85a4f3efa2883c414ed8ff59aea263b85b7687 (patch)
treea033245a65239971a0b034f14a1a1bfd39bc2c92 /src/util.c
parentc5f0532ff10abcf6808ff503fb10ca9f4df81efd (diff)
cgroup: optionally mount a specific cgroup controllers together, and add cpu+cpuacct to the default
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index e31e0f575a..65d4b143dc 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2895,19 +2895,25 @@ ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
return n;
}
-int path_is_mount_point(const char *t) {
+int path_is_mount_point(const char *t, bool allow_symlink) {
struct stat a, b;
char *parent;
int r;
- if (lstat(t, &a) < 0) {
+ if (allow_symlink)
+ r = stat(t, &a);
+ else
+ r = lstat(t, &a);
+
+ if (r < 0) {
if (errno == ENOENT)
return 0;
return -errno;
}
- if ((r = parent_of_path(t, &parent)) < 0)
+ r = parent_of_path(t, &parent);
+ if (r < 0)
return r;
r = lstat(parent, &b);