X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=device-src%2Frait-device.c;h=d0b0e893c028f263eb445147e12113482b22f1e4;hb=6913ab6f92b7dc3023568a219745123abf878149;hp=5b348927853094df26b103aafed9f599f0ee2c09;hpb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;p=debian%2Famanda diff --git a/device-src/rait-device.c b/device-src/rait-device.c index 5b34892..d0b0e89 100644 --- a/device-src/rait-device.c +++ b/device-src/rait-device.c @@ -1260,6 +1260,8 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, dself->access_mode = mode; dself->in_file = FALSE; + amfree(dself->volume_label); + amfree(dself->volume_time); ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { @@ -1297,7 +1299,7 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, device_error_or_status(child))); } else { if (child->volume_label != NULL && child->volume_time != NULL) { - if (dself->volume_label != NULL && dself->volume_time != NULL) { + if (label_from_device) { if (strcmp(child->volume_label, dself->volume_label) != 0 || strcmp(child->volume_time, dself->volume_time) != 0) { /* Mismatch! (Two devices provided different labels) */ @@ -1313,6 +1315,7 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, label_from_device); append_message(&failure_errmsgs, this_message); total_status |= DEVICE_STATUS_DEVICE_ERROR; + g_warning("RAIT device children have different labels or timestamps"); } } else { /* First device with a volume. */ @@ -1325,6 +1328,7 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, char * this_message = g_strdup_printf("%s: Says label read, but no volume " "label found.", child->device_name); + g_warning("RAIT device child has NULL volume or label"); append_message(&failure_errmsgs, this_message); total_status |= DEVICE_STATUS_DEVICE_ERROR; } @@ -1336,7 +1340,7 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, dself->status = total_status; - if (!success) { + if (total_status != DEVICE_STATUS_SUCCESS || !success) { device_set_error(dself, failure_errmsgs, total_status); return FALSE; }