+
+ device = device_open(device_name);
+ g_assert(device != NULL);
+ if (device->status != DEVICE_STATUS_SUCCESS) {
+ g_fprintf(stderr, _("%s: slot %3s: Could not open device: %s.\n"),
+ get_pname(), slotstr, device_error(device));
+ return 0;
+ }
+
+ if (!device_configure(device, TRUE)) {
+ g_fprintf(stderr, _("%s: slot %3s: Could not configure device: %s.\n"),
+ get_pname(), slotstr, device_error(device));
+ return 0;
+ }
+
+ device_status = device_read_label(device);
+ if (device_status != DEVICE_STATUS_SUCCESS) {
+ g_fprintf(stderr, _("%s: slot %3s: %s\n"),
+ get_pname(), slotstr, device_error_or_status(device));
+ g_object_unref(device);
+ return 0;
+ }
+
+ g_fprintf(stderr, _("%s: slot %3s: time %-14s label %s"),
+ get_pname(), slotstr, device->volume_time, device->volume_label);
+
+ if(strcmp(device->volume_label, status->searchlabel) != 0) {
+ g_fprintf(stderr, _(" (wrong tape)\n"));
+ g_object_unref(device);
+ return 0;
+ } else {
+ g_fprintf(stderr, _(" (exact label match)\n"));
+ g_object_unref(device);
+ status->found = 1;
+ return 1;
+ }
+
+ g_assert_not_reached();