From a682f18b338d1eda088744d9b103689ff674f580 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 4 Apr 2022 11:42:32 -0500 Subject: [PATCH] Earlier test ensures dev isn't null when !FLAG(a), so don't test same again. --- toys/lsb/mount.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/toys/lsb/mount.c b/toys/lsb/mount.c index 22021ab9..10e8e9e4 100644 --- a/toys/lsb/mount.c +++ b/toys/lsb/mount.c @@ -232,8 +232,7 @@ static void mount_filesystem(char *dev, char *dir, char *type, i = strlen(type); if (i) type[i-1] = 0; } - if (FLAG(v)) - printf("try '%s' type '%s' on '%s'\n", dev, type, dir); + if (FLAG(v)) printf("try '%s' type '%s' on '%s'\n", dev, type, dir); for (;;) { rc = mount(dev, dir, type, flags, opts); // Did we succeed, fail unrecoverably, or already try read-only? @@ -354,8 +353,7 @@ void mount_main(void) continue; } else { if (dir && strcmp(dir, mm->dir)) continue; - if (dev && strcmp(dev, mm->device) && (dir || strcmp(dev, mm->dir))) - continue; + if (strcmp(dev, mm->device) && (dir || strcmp(dev, mm->dir))) continue; } // Don't overmount the same dev on the same directory -- 2.39.2