Handle case where same device is mounted twice
authorJamie Cameron <jcameron@webmin.com>
Wed, 25 May 2011 19:52:23 +0000 (12:52 -0700)
committerJamie Cameron <jcameron@webmin.com>
Wed, 25 May 2011 19:52:23 +0000 (12:52 -0700)
http://www.virtualmin.com/node/18280

quota/linux-lib.pl

index ca6fcfb..e406090 100755 (executable)
@@ -776,10 +776,10 @@ local $mm = $module_info{'usermin'} ? "usermount" : "mount";
 local ($m, %mtab);
 foreach $m (&foreign_call($mm, "list_mounted", 1)) {
        if ($m->[3] =~ /loop=([^,]+)/) {
-               $mtab{&resolve_and_simplify("$1")} = $m->[0];
+               $mtab{&resolve_and_simplify("$1")} ||= $m->[0];
                }
        else {
-               $mtab{&resolve_and_simplify($m->[1])} = $m->[0];
+               $mtab{&resolve_and_simplify($m->[1])} ||= $m->[0];
                }
        }
 return %mtab;