In parse_mount_entries return the loop device instead of the mounted

file for loop mounts.
This commit is contained in:
Alexandre Julliard 2005-10-13 14:32:22 +00:00
parent d2e5469bbf
commit 45885d136c
1 changed files with 10 additions and 0 deletions

View File

@ -268,6 +268,16 @@ static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
return device + 4;
}
}
else if (!stat( entry->mnt_fsname, &st ) && S_ISREG(st.st_mode))
{
/* if device is a regular file check for a loop mount */
if ((device = strstr( entry->mnt_opts, "loop=" )))
{
char *p = strchr( device + 5, ',' );
if (p) *p = 0;
return device + 5;
}
}
else
return entry->mnt_fsname;
}