From: Julian Seward Date: Fri, 11 Mar 2005 02:47:32 +0000 (+0000) Subject: Fix PRE wrapper for sys_exit. X-Git-Tag: svn/VALGRIND_3_0_0~1050 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae8df0379bfa5fa5ac76220bfe43299320260305;p=thirdparty%2Fvalgrind.git Fix PRE wrapper for sys_exit. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3268 --- diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 4c0b9dc614..0be225a4f5 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -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)