Index: /trunk/ippTools/src/pzgetimfiles.c
===================================================================
--- /trunk/ippTools/src/pzgetimfiles.c	(revision 17743)
+++ /trunk/ippTools/src/pzgetimfiles.c	(revision 17744)
@@ -97,14 +97,14 @@
 
     psString cmdOutput = psSlurpFile(output);
-    int exitStatus = pclose(output);
-
-    if (exitStatus != 0) {
+    int status = pclose(output);
+
+    if (status != 0) {
         // mark the summitExp row as faulted
-        if (!p_psDBRunQuery(config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", exitStatus, filesetid, camera, telescope)) {
+        if (!p_psDBRunQuery(config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", WEXITSTATUS(status), filesetid, camera, telescope)) {
             psError(PS_ERR_UNKNOWN, false, "database error");
         }
 
         psError(PS_ERR_UNKNOWN, true, "%s failed with exit status %d",
-            FILESET_LS_CMD, exitStatus);
+            FILESET_LS_CMD, WEXITSTATUS(status));
         psFree(cmdOutput);
         return false;
