From bbe09cbe06f729e0a06e15b026b1ade56dce13af Mon Sep 17 00:00:00 2001 From: cracauer Date: Sun, 28 Dec 2003 01:20:03 +0000 Subject: Fix signal behaviour. In my last change I made sure that the signal as reported from a truss exit is the same as if truss wasn't between parent and trussed program. I was smart enough to not have it coredump on SIGQUIT but it didn't ocur to me SIGSEGV might cause a coredump, too :-) So get rid of SIGQUIT extra hack and limit coredumpsize to zero instead. Tested: still works, correct signal reported. No more codedumps from SIGSEGV in the trussed proces. This file compiles cleanly on AMD64 (sledge). PR: Submitted by: Reviewed by: Approved by: Obtained from: MFC after: --- usr.bin/truss/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index 1514820..5964335 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -41,7 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -304,8 +306,11 @@ START_TRACE: } while (pfs.why != S_EXIT); fflush(trussinfo->outfile); if (sigexit) { - if (sigexit == SIGQUIT) - exit(sigexit); + struct rlimit rlp; + + rlp.rlim_cur = 0; + rlp.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rlp); (void) signal(sigexit, SIG_DFL); (void) kill(getpid(), sigexit); } -- cgit v1.1