]> git.sur5r.net Git - bacula/bacula/commitdiff
dvd.c:do_mount_dev: When checking if the DVD is mounted, do not count ., .. and ...
authorNicolas Boichat <nicolas@boichat.ch>
Fri, 14 Oct 2005 08:41:12 +0000 (08:41 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Fri, 14 Oct 2005 08:41:12 +0000 (08:41 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2440 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/nb-1.37
bacula/src/stored/dvd.c

index c9715dec82b24870b53020a3fef7c71dab0ef1df..278caa62ce19f727478d860045dba2e118e074f3 100644 (file)
@@ -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
index 21f1d992bb6e63455e8cdaf27c9ac7fab9c32ce0..ef4e69f3445b0fd9bf061897c7b72e8b6ad184d9 100644 (file)
@@ -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: