]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix PRE wrapper for sys_exit.
authorJulian Seward <jseward@acm.org>
Fri, 11 Mar 2005 02:47:32 +0000 (02:47 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 11 Mar 2005 02:47:32 +0000 (02:47 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3268

coregrind/vg_syscalls.c

index 4c0b9dc6140658b85e6714a7799cd02dca614747..0be225a4f50c7e263282c2dc910d83d281337b5e 100644 (file)
@@ -1363,7 +1363,17 @@ VG_(generic_POST_sys_recvmsg) ( ThreadId tid,
 
 PRE(sys_exit, Special)
 {
-   VG_(core_panic)("syscall exit() not caught by the scheduler?!");
+   /* simple; just make this thread exit */
+   PRINT("exit( %d )", ARG1);
+   PRE_REG_READ1(void, "exit", int, exitcode);
+   tst->exitreason = VgSrc_ExitSyscall;
+   tst->os_state.exitcode = ARG1;
+   /* exit doesn't return anything (it doesn't return.)
+      Nevertheless, if we don't do this, the result-not-assigned-
+      yet-you-said-you-were-Special assertion in the main syscall
+      handling logic will fire.  Hence ..
+   */
+   SET_RESULT(0);
 }
 
 PRE(sys_sched_yield, MayBlock)