X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmount.c;h=38547f7294df3a23e9b23fa2253b925deb2415de;hp=9a201f33eda61990af100a41d0f935d48668713f;hb=1e59887dc92e163163051e627817e1675374cd22;hpb=e51bc1a23e8f581e4fe46aa4df1bd93b7042c184;ds=sidebyside diff --git a/src/mount.c b/src/mount.c index 9a201f33e..38547f729 100644 --- a/src/mount.c +++ b/src/mount.c @@ -1487,57 +1487,6 @@ void mount_fd_event(Manager *m, int events) { } } -int mount_path_is_mounted(Manager *m, const char* path) { - char *t; - int r; - - assert(m); - assert(path); - - if (path[0] != '/') - return 1; - - if (!(t = strdup(path))) - return -ENOMEM; - - path_kill_slashes(t); - - for (;;) { - char *e, *slash; - Unit *u; - - if (!(e = unit_name_from_path(t, ".mount"))) { - r = -ENOMEM; - goto finish; - } - - u = manager_get_unit(m, e); - free(e); - - if (u && - (MOUNT(u)->from_etc_fstab || MOUNT(u)->from_fragment) && - MOUNT(u)->state != MOUNT_MOUNTED) { - r = 0; - goto finish; - } - - assert_se(slash = strrchr(t, '/')); - - if (slash == t) { - r = 1; - goto finish; - } - - *slash = 0; - } - - r = 1; - -finish: - free(t); - return r; -} - static void mount_reset_maintenance(Unit *u) { Mount *m = MOUNT(u);