+ /* check that all of the volume labels agree */
+ if (success) {
+ for (i = 0; i < self->private->children->len; i ++) {
+ Device *child = g_ptr_array_index(self->private->children, i);
+
+ if (child->volume_label != NULL && child->volume_time != NULL) {
+ if (dself->volume_label != NULL && dself->volume_time != NULL) {
+ if (strcmp(child->volume_label, dself->volume_label) != 0 ||
+ strcmp(child->volume_time, dself->volume_time) != 0) {
+ /* Mismatch! (Two devices provided different labels) */
+ g_fprintf(stderr, "%s: Label (%s/%s) is different "
+ "from label (%s/%s) found at "
+ "device %s",
+ child->device_name,
+ child->volume_label,
+ child->volume_time,
+ dself->volume_label,
+ dself->volume_time,
+ label_from_device);
+ success = FALSE;
+ }
+ } else {
+ /* First device with a volume. */
+ dself->volume_label = g_strdup(child->volume_label);
+ dself->volume_time = g_strdup(child->volume_time);
+ label_from_device = g_strdup(child->device_name);
+ }
+ } else {
+ /* Device problem, it says it succeeded but sets no label? */
+ g_fprintf(stderr, "%s: %s",
+ child->device_name,
+ "Says label read, but device->volume_label "
+ " is NULL.");
+ success = FALSE;
+ }
+ }
+ }
+
+ amfree(label_from_device);