assert(a);
assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_FAILED);
- if (path_is_mount_point(a->where, false)) {
- log_unit_error(u->id,
- "Path %s is already a mount point, refusing start for %s",
- a->where, u->id);
+ if (path_is_mount_point(a->where, false) > 0) {
+ log_unit_error(u->id, "Path %s is already a mount point, refusing start for %s", a->where, u->id);
return -EEXIST;
}
return log_oom();
t = path_is_mount_point(where, true);
- if (t < 0) {
+ if (t < 0 && t != -ENOENT) {
log_error_errno(t, "Failed to detect whether %s is a mount point: %m", where);
if (r == 0)
to = strjoina(dest, "/sys/fs/cgroup/", hierarchy);
r = path_is_mount_point(to, false);
- if (r < 0)
+ if (r < 0 && r != -ENOENT)
return log_error_errno(r, "Failed to determine if %s is mounted already: %m", to);
if (r > 0)
return 0;
int r;
r = path_is_mount_point("/sys/fs/cgroup", false);
- if (r <= 0)
- return r < 0 ? r : -ENOENT;
+ if (r < 0)
+ return r;
+ if (r == 0)
+ return -ENOENT;
/* Cache this to save a few stat()s */
good = true;
test_parent("/aa///file...", "/aa///");
test_parent("file.../", NULL);
- assert_se(path_is_mount_point("/", true));
- assert_se(path_is_mount_point("/", false));
+ assert_se(path_is_mount_point("/", true) > 0);
+ assert_se(path_is_mount_point("/", false) > 0);
+
+ assert_se(path_is_mount_point("/proc", true) > 0);
+ assert_se(path_is_mount_point("/proc", false) > 0);
+
+ assert_se(path_is_mount_point("/sys", true) > 0);
+ assert_se(path_is_mount_point("/sys", false) > 0);
{
char p1[] = "aaa/bbb////ccc";