+/**
+Reads the list of mounted devices from /etc/mtab and records the mount points.
+*/
+void check_mounts(Device *devices)
+{
+ FILE *file;
+ struct mntent *me;
+
+ file = setmntent("/etc/mtab", "r");
+ if(!file)
+ return;
+
+ while((me = getmntent(file)))
+ {
+ int i;
+
+ for(i=0; devices[i].node; ++i)
+ if(!strcmp(devices[i].devname, me->mnt_fsname))
+ {
+ devices[i].mount_point = strdup(me->mnt_dir);
+
+ if(verbosity>=1)
+ printf("Device %s is mounted on %s\n", devices[i].node, devices[i].mount_point);
+ }
+ }
+
+ endmntent(file);
+}
+
+/**
+Returns an array of all mountable devices.
+*/