From 21bee7825f1b78ca5721bb07769b3615db0c34a3 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 14 Oct 2005 08:41:12 +0000 Subject: [PATCH] dvd.c:do_mount_dev: When checking if the DVD is mounted, do not count ., .. and .keep (needed on Gentoo). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2440 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/nb-1.37 | 2 ++ bacula/src/stored/dvd.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bacula/nb-1.37 b/bacula/nb-1.37 index c9715dec82..278caa62ce 100644 --- a/bacula/nb-1.37 +++ b/bacula/nb-1.37 @@ -4,6 +4,8 @@ General: Changes to 1.37.*: +14Oct05 + - dvd.c:do_mount_dev: When checking if the DVD is mounted, do not count ., .. and .keep (needed on Gentoo). 15Aug05 - Convert dvd-writepart to Python. - Increase delay from 3 seconds to 5 seconds between SIGTERM and SIGKILL when diff --git a/bacula/src/stored/dvd.c b/bacula/src/stored/dvd.c index 21f1d992bb..ef4e69f344 100644 --- a/bacula/src/stored/dvd.c +++ b/bacula/src/stored/dvd.c @@ -182,15 +182,21 @@ static bool do_mount_dev(DEVICE* dev, int mount, int dotimeout) dev->device->mount_point, dev->print_name()); break; } - count++; + if ((strcmp(result->d_name, ".")) && (strcmp(result->d_name, "..")) && (strcmp(result->d_name, ".keep"))) { + count++; /* result->d_name != ., .. or .keep (Gentoo-specific) */ + } + else { + Dmsg2(129, "open_mounted_dev: ignoring %s in %s\n", + result->d_name, dev->device->mount_point); + } } free(entry); closedir(dp); - Dmsg1(29, "open_mounted_dev: got %d files in the mount point\n", count); + Dmsg1(29, "open_mounted_dev: got %d files in the mount point (not counting ., .. and .keep)\n", count); - if (count > 2) { - mount = 1; /* If we got more than . and .. */ + if (count > 0) { + mount = 1; /* If we got more than ., .. and .keep */ break; /* there must be something mounted */ } get_out: -- 2.39.5