]> mj.ucw.cz Git - eval.git/commitdiff
Internal errors are reported properly.
authorMartin Mares <mj@ucw.cz>
Fri, 22 Aug 2008 18:23:49 +0000 (20:23 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 22 Aug 2008 18:23:49 +0000 (20:23 +0200)
box/box.c

index 09f7fe4c8c577bd0503201b6763f3a8442ce1400..5bf43b32339a4b393ab444c53c9ac92be830e1f9 100644 (file)
--- a/box/box.c
+++ b/box/box.c
@@ -799,11 +799,18 @@ boxkeeper(void)
        {
          box_pid = 0;
          final_stats(&rus);
-         // FIXME: If the process has exited before being ptraced, signal an internal error
          if (WEXITSTATUS(stat))
            {
-             meta_printf("exitcode:%d\n", WEXITSTATUS(stat));
-             err("RE: Exited with error status %d", WEXITSTATUS(stat));
+             if (syscall_count)
+               {
+                 meta_printf("exitcode:%d\n", WEXITSTATUS(stat));
+                 err("RE: Exited with error status %d", WEXITSTATUS(stat));
+               }
+             else
+               {
+                 // Internal error happened inside the child process and it has been already reported.
+                 box_exit(2);
+               }
            }
          if (timeout && total_ms > timeout)
            err("TO: Time limit exceeded");