]> mj.ucw.cz Git - eval.git/commitdiff
Clean up exit codes of judges.
authorMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 21:42:36 +0000 (23:42 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 21:42:36 +0000 (23:42 +0200)
exit(1) always means an error in the judged output,
exit(2) is used whenever an internal error is encountered (missing files etc.).

TODO
judge/judge.h
judge/utils.c

diff --git a/TODO b/TODO
index 1ece4b058f4b8c5e80537d073983b04a99a50816..db242924018222523bbe7130ef33502eae17a515 100644 (file)
--- a/TODO
+++ b/TODO
@@ -11,7 +11,6 @@ box: memory usage statistics (need to search for VMPeak in /proc/$PID/status, bu
 
 Judges
 ~~~~~~
-clean up exit codes
 test cases for judge-shuff
 
 Environment
index 3ac8e4cf24b42eccb88ca700207d05f46b2f237d..8ba6adb1d89c86fbcc3af57467ee617609e5eea6 100644 (file)
@@ -16,7 +16,7 @@
 
 /* utils.c: Utility functions */
 
-void die(char *msg, ...) NONRET;
+void die(char *msg, ...) NONRET;               /* Dies with exit code 2 (judge error) */
 void *xmalloc(size_t size);
 void *xrealloc(void *p, size_t size);
 
index cbe5c3c3f085bb67470c02d96b0a95ca1c5bfadd..128e1feb8001c30ed3fd9cac435469058e47428e 100644 (file)
@@ -17,7 +17,7 @@ void die(char *msg, ...)
   vfprintf(stderr, msg, args);
   fputc('\n', stderr);
   va_end(args);
-  exit(1);
+  exit(2);
 }
 
 void *xmalloc(size_t size)