Commits

clach04 committed fadec22 Draft

more diagnostics in case of jam error when permision denied error 13. So far this new code has not caught a failure.
I'm clear the unlink call needs a check, also the wait appears to have the potential to see a state change due to signals that is not a process exit condition. I don't want to change this without more evidence.

  • Participants
  • Parent commits b7858cc
  • Branches debug_vm2.5.3

Comments (0)

Files changed (1)

 	    f = fopen( cmdtab[ slot ].tempfile, "w" );
 	    if (f == NULL)
 	    {
+            int tmp_slot=0;
+            char tmp_filename[2048+1];
 	        printf("Unable to open file %s for writing, errno = %d\n", cmdtab[ slot ].tempfile, errno);
 	        printf("Attention Actian/Ingres/Vectorwise builders if you see this error please contact Chris Clark or Viktoriya Driker\n");
+	        printf("MAXJOBS = %d\n", MAXJOBS);
+	        printf("slot = %d\n", slot);
+
+            for( tmp_slot = 0; slot < MAXJOBS; tmp_slot++ )
+            {
+                printf("cmdtab[%d].pid = %d\n", tmp_slot, cmdtab[ tmp_slot ].pid);
+                if (cmdtab[tmp_slot].tempfile) /* NOTE I'm not sure how this ever gets set to NULL if not set */
+                    strncpy(tmp_filename, cmdtab[tmp_slot].tempfile, sizeof(tmp_filename)-1);
+                else
+                    strcpy(tmp_filename, "NULL filename");
+                printf("    cmdtab[%d].tempfile >%s<\n", tmp_slot, tmp_filename);
+            }
 	        exit(EXITBAD);
 	    }
 
 
 # ifdef USE_EXECNT
 	/* Clear the temp file */
-
-	unlink( cmdtab[ i ].tempfile );
+    {
+        int unlink_res=0;
+	unlink_res=unlink( cmdtab[ i ].tempfile );
+        if (unlink_res)
+        {
+            /* ignore file does not exist errors */
+            if (errno != ENOENT) /*ENOFILE*/
+            {
+                printf("Unable to delete file %s , errno = %d\n", cmdtab[ i ].tempfile, errno);
+                printf("status = %d\n", status);
+                printf("Attention Actian/Ingres/Vectorwise builders if you see this error please contact Chris Clark or Viktoriya Driker\n");
+                exit(EXITBAD);
+            }
+        }
+    }
 # endif
 
 	/* Drive the completion */