It expects to get only a single entry for each "f_ent.mnt_fsname", but when a "mount -o bind" is active, as it is with a savefolder, it gets an extra entry for each "mount -o bind". This extra entry has the same "f_ent.mnt_fsname" but a different "f_ent.mnt_dir".
The entry corresponding to the one expected, is the first one, but the current code stores the last one.
So, near the top of the loop it needs to "continue" if it gets an entry whose "f_ent.mnt_fsname" is the same as the previous entry.
Or it could "continue" if the hash table already contains an entry for this "f_ent.mnt_fsname". Maybe something like:
Code: Select all
entry.devnode = g_strdup(f_ent.mnt_fsname);
if (g_hash_table_contains(self->mounts, entry.devnode))
continue;
gyro