Index: amanda.git/device-src/rait-device.c
===================================================================
--- amanda.git.orig/device-src/rait-device.c	2014-08-27 01:44:46.000000000 +0100
+++ amanda.git/device-src/rait-device.c	2014-08-28 20:27:34.000000000 +0100
@@ -1096,7 +1096,7 @@ static DeviceStatusFlags rait_device_rea
     for (i = 0; i < ops->len; i ++) {
         GenericOp * op = g_ptr_array_index(ops, i);
         DeviceStatusFlags result = GPOINTER_TO_INT(op->result);
-        if (op->result == DEVICE_STATUS_SUCCESS) {
+        if (result == DEVICE_STATUS_SUCCESS) {
             if (first_success == NULL) {
                 /* This is the first successful device. */
                 first_success = op->child;
