]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dircmd.c
ebl Fix a bug in read_close_session which return random status
[bacula/bacula] / bacula / src / stored / dircmd.c
index 1c31bf233aade13f452c37dbc7e45daef5a1900a..205fe140df3566000f74e09f5e30d77ebe67efa3 100644 (file)
@@ -563,7 +563,7 @@ static DCR *find_device(JCR *jcr, POOL_MEM &devname, int drive)
    unbash_spaces(devname);
    foreach_res(device, R_DEVICE) {
       /* Find resource, and make sure we were able to open it */
-      if (fnmatch(device->hdr.name, devname.c_str(), 0) == 0) {
+      if (strcmp(device->hdr.name, devname.c_str()) == 0) {
          if (!device->dev) {
             device->dev = init_dev(jcr, device);
          }
@@ -581,7 +581,7 @@ static DCR *find_device(JCR *jcr, POOL_MEM &devname, int drive)
    if (!found) {
       foreach_res(changer, R_AUTOCHANGER) {
          /* Find resource, and make sure we were able to open it */
-         if (fnmatch(devname.c_str(), changer->hdr.name, 0) == 0) {
+         if (strcmp(devname.c_str(), changer->hdr.name) == 0) {
             /* Try each device in this AutoChanger */
             foreach_alist(device, changer->device) {
                Dmsg1(100, "Try changer device %s\n", device->hdr.name);
@@ -735,7 +735,7 @@ static bool mount_cmd(JCR *jcr)
                                     "If this is not a blank tape, try unmounting and remounting the Volume.\n"),
                              dev->print_name());
                }
-            } else if (dev->is_dvd()) {
+            } else if (dev->is_unmountable()) {
                if (dev->mount(1)) {
                   bnet_fsend(dir, _("3002 Device %s is mounted.\n"), 
                      dev->print_name());
@@ -785,7 +785,7 @@ static bool unmount_cmd(JCR *jcr)
             if (!dev->is_busy()) {
                unload_autochanger(dcr, -1);          
             }
-            if (dev->is_dvd()) {
+            if (dev->is_unmountable()) {
                if (dev->unmount(0)) {
                   bnet_fsend(dir, _("3002 Device %s unmounted.\n"), 
                      dev->print_name());
@@ -804,7 +804,7 @@ static bool unmount_cmd(JCR *jcr)
                /* ***FIXME**** what is this ????  */
                dev->close();
             }
-            if (dev->is_dvd() && !dev->unmount(0)) {
+            if (dev->is_unmountable() && !dev->unmount(0)) {
                bnet_fsend(dir, _("3907 %s"), dev->bstrerror());
             } else {
                dev->set_blocked(BST_UNMOUNTED_WAITING_FOR_SYSOP);
@@ -835,7 +835,7 @@ static bool unmount_cmd(JCR *jcr)
             if (!unload_autochanger(dcr, -1)) {
                dev->close();
             }
-            if (dev->is_dvd() && !dev->unmount(0)) {
+            if (dev->is_unmountable() && !dev->unmount(0)) {
                bnet_fsend(dir, _("3907 %s"), dev->bstrerror());
             } else {
                bnet_fsend(dir, _("3002 Device %s unmounted.\n"),