X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=mount-setup.c;h=a804030df00242050ba62cafdef3ba6533a400e2;hb=8d567588cad053f79abe603ab113e1b85a92f1da;hp=013e6144cfc142532f17358ccea4e0ab83be3959;hpb=2076ca540e4ffdd320e086c8b570a5bf19546022;p=elogind.git diff --git a/mount-setup.c b/mount-setup.c index 013e6144c..a804030df 100644 --- a/mount-setup.c +++ b/mount-setup.c @@ -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)