chiark / gitweb /
automount: implement automount unit type
[elogind.git] / mount-setup.c
index 013e6144cfc142532f17358ccea4e0ab83be3959..a804030df00242050ba62cafdef3ba6533a400e2 100644 (file)
@@ -64,37 +64,12 @@ bool mount_point_is_api(const char *path) {
         return false;
 }
 
-static int is_mount_point(const char *t) {
-        struct stat a, b;
-        char *copy;
-
-        if (lstat(t, &a) < 0) {
-
-                if (errno == ENOENT)
-                        return 0;
-
-                return -errno;
-        }
-
-        if (!(copy = strdup(t)))
-                return -ENOMEM;
-
-        if (lstat(dirname(copy), &b) < 0) {
-                free(copy);
-                return -errno;
-        }
-
-        free(copy);
-
-        return a.st_dev != b.st_dev;
-}
-
 static int mount_one(const MountPoint *p) {
         int r;
 
         assert(p);
 
-        if ((r = is_mount_point(p->where)) < 0)
+        if ((r = path_is_mount_point(p->where)) < 0)
                 return r;
 
         if (r > 0)