Imported Debian patch 2.4.4p3-2
[debian/amanda] / changer-src / chg-scsi.c
index 43bf315bf04e40b2687e364e2ebf73e15f4dbf38..01cc133b83c5e0288b52f3954171d7b25ed1e13a 100644 (file)
@@ -1303,8 +1303,14 @@ int main(int argc, char *argv[])
     break;
   case COM_LABEL: /* Update BarCode/Label mapping file */
     pbarcoderes->action = BARCODE_PUT;
+    pbarcoderes->data.from = pbarcoderes->data.slot = get_current_slot(slot_file);
     strcpy(pbarcoderes->data.voltag, com.parameter);
-    strcpy( pbarcoderes->data.barcode, pDTE[drive_num].VolTag);
+    if (BarCode(fd) == 1 && emubarcode != 1)
+    {
+       strcpy( pbarcoderes->data.barcode, pDTE[drive_num].VolTag);
+    } else {
+       strcpy( pbarcoderes->data.barcode, com.parameter);
+    }
     MapBarCode(chg.labelfile, pbarcoderes);
     printf("0 0 0\n");
     break;