module/removables: relaxed mountinfo matching criteria

Fixes mount detection on e.g. Artix Linux.
This commit is contained in:
Daniel Eklöf 2019-09-27 19:31:12 +02:00
parent 43157e42cc
commit 0e7db5f397
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -159,10 +159,10 @@ find_mount_points(const char *dev_path, mount_point_list_t *mount_points)
while (fgets(line, sizeof(line), f) != NULL) {
char *dev = NULL, *path = NULL;
if (sscanf(line, "%*u %*u %*u:%*u %*s %ms %*s %*[^-] - %*s %ms %*s",
if (sscanf(line, "%*u %*u %*u:%*u %*s %ms %*[^-] - %*s %ms %*s",
&path, &dev) != 2)
{
LOG_ERR("failed to parse /proc/mounts");
LOG_ERR("failed to parse /proc/self/mountinfo: %s", line);
free(dev);
free(path);
break;