Index: /branches/eam_branches/20091201/pswarp/src/pswarpLoop.c
===================================================================
--- /branches/eam_branches/20091201/pswarp/src/pswarpLoop.c	(revision 26827)
+++ /branches/eam_branches/20091201/pswarp/src/pswarpLoop.c	(revision 26828)
@@ -162,19 +162,29 @@
         pmChip *chip;
         pmFPAview *view = pmFPAviewAlloc(0);
-        pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
+            return false;
+        }
         while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
             psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
             if (!chip->process || !chip->file_exists) { continue; }
-            pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
+            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
+                return false;
+            }
             pmCell *cell;
             while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
                 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
                 if (!cell->process || !cell->file_exists) { continue; }
-                pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
-                pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
-            }
-            pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
-        }
-        pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
+                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) ||
+                    !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
+                    return false;
+                }
+            }
+            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
+                return false;
+            }
+        }
+        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
+            return false;
+        }
         psFree(view);
 
@@ -211,5 +221,7 @@
 
     // files associated with the science image
-    pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
+        return false;
+    }
 
     pmChip *chip;
@@ -217,5 +229,7 @@
         psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
         if (!chip->process || !chip->file_exists) { continue; }
-        pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
+            return false;
+        }
 
         // read WCS data from the corresponding header
@@ -242,5 +256,7 @@
             psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
             if (!cell->process || !cell->file_exists) { continue; }
-            pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
+                return false;
+            }
 
             psListAdd(cells, PS_LIST_TAIL, cell);
@@ -249,5 +265,7 @@
             pmReadout *readout;
             while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) {
-                pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
+                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
+                    return false;
+                }
                 if (!readout->data_exists) {
                     continue;
@@ -264,9 +282,15 @@
                 pswarpTransformReadout(output, readout, config);
 
-                pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
-            }
-            pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
-        }
-        pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
+                if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
+                    return false;
+                }
+            }
+            if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
+                return false;
+            }
+        }
+        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
+            return false;
+        }
     }
 
@@ -368,5 +392,7 @@
     }
 
-    pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
+    if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
+        return false;
+    }
 
     // Done with the detector side of things
