summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-07-14 02:58:12 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-07-14 05:30:29 +0100
commit4d4dcfb33c5d9fa31c9916e106bee309ec7b4b01 (patch)
tree0837a7872464d2518fe7e23a240dd3f6e0c34d30
parent3d40a1b591cd569f95891116cd033b496de0f92b (diff)
downloadfstools-4d4dcfb33c5d9fa31c9916e106bee309ec7b4b01.tar.gz
blockd: detect mountpoint of /dev/mapper/*
If a device cannot be found in /dev, also try /dev/mapper. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--blockd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/blockd.c b/blockd.c
index d6dfeb8..f6973d8 100644
--- a/blockd.c
+++ b/blockd.c
@@ -89,6 +89,15 @@ _find_mount_point(char *device)
mp = find_mount_point(dev, 0);
free(dev);
+ if (mp)
+ return mp;
+
+ if (asprintf(&dev, "/dev/mapper/%s", device) == -1)
+ exit(ENOMEM);
+
+ mp = find_mount_point(dev, 0);
+ free(dev);
+
return mp;
}
@@ -584,8 +593,8 @@ static int autofs_mount(void)
uloop_timeout_set(&autofs_expire_timer, AUTOFS_EXPIRE_TIMER);
- fcntl(fd_autofs_write, F_SETFD, fcntl(fd_autofs_write, F_GETFD) | FD_CLOEXEC);
- fcntl(fd_autofs_read.fd, F_SETFD, fcntl(fd_autofs_read.fd, F_GETFD) | FD_CLOEXEC);
+ fcntl(fd_autofs_write, F_SETFD, fcntl(fd_autofs_write, F_GETFD) | FD_CLOEXEC);
+ fcntl(fd_autofs_read.fd, F_SETFD, fcntl(fd_autofs_read.fd, F_GETFD) | FD_CLOEXEC);
return 0;
}