Imported Upstream version 2.5.1p3
[debian/amanda] / server-src / amlabel.c
index ab5169bbc937819e6cd35c52aa5754ab7b65f962..b04dcff2732460737404b2c7e831dcc6c8ec90ad 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amlabel.c,v 1.53 2006/07/25 18:27:57 martinea Exp $
+ * $Id: amlabel.c,v 1.53.2.2 2007/02/06 14:07:44 martinea Exp $
  *
  * write an Amanda label on a tape
  */
@@ -188,7 +188,12 @@ main(
                    new_argv[0], conffile);
            usage();
        }
-       tapename = stralloc(getconf_str(CNF_TAPEDEV));
+       tapename = getconf_str(CNF_TAPEDEV);
+       if (tapename == NULL) {
+           error("No tapedev specified");
+       } else {
+           tapename = stralloc(tapename);
+       }
 #ifdef HAVE_LIBVTBLC
        rawtapedev = stralloc(getconf_str(CNF_RAWTAPEDEV));
 #endif /* HAVE_LIBVTBLC */
@@ -456,6 +461,10 @@ main(
                error("couldn't write tapelist: %s", strerror(errno));
                /*NOTREACHED*/
            }
+
+            if (have_changer) {
+                changer_label(outslot, label);
+            }
        } /* write tape list */
        printf(", done.\n");
     } else {