Links like that can remain from using autofs and can cause mounting
errors after switching to non-autofs:
block: mounting /dev/sda1 (vfat) as /mnt/sda1 failed (2) - No such file or directory
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
{
struct mount *m;
struct probe_info *pr;
+ struct stat st;
char _target[32];
char *target;
char *device;
check_filesystem(pr);
mkdir_p(target);
+ if (!lstat(target, &st) && S_ISLNK(st.st_mode))
+ unlink(target);
err = handle_mount(pr->dev, target, pr->type, m);
if (err) {