Hi Jan,
> + mnttab = fopen("/etc/mtab", "r");
Isn't it better to use "/proc/mounts" here? Otherwise, if the FS was
mounted using "mount" syscall, then this code will fail to find the
correct mount root.
> + while ((ent = getmntent(mnttab))) {
> + len = strlen(ent->mnt_dir);
> + if (strncmp(ent->mnt_dir, path, len) == 0) {
> + /* match found */
> + if (longest_matchlen < len) {
> + free(longest_match);
> + longest_matchlen = len;
> + longest_match = strdup(ent->mnt_dir);
Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html