- if (path) {
- char rpath[PATH_MAX] = {'\0'};
-
- if (!realpath(path, rpath)) {
- rc = -errno;
- fprintf(stderr, "error: invalid path '%s': %s\n",
- path, strerror(-rc));
- } else {
- rc = llapi_search_mounts(rpath, 0, mntdir, fsname);
- if (rc == 0 && mntdir[0] != '\0') {
- rc = mntdf(mntdir, fsname, pool_name,
- ishow, cooked);
- printf("\n");
- }
- }
- } else {
- int index = 0;
+ while (!llapi_search_mounts(path, index++, mntdir, fsname)) {
+ /* Check if we have a mount point */
+ if (mntdir[0] == '\0')
+ continue;