diff options
author | cracauer <cracauer@FreeBSD.org> | 2003-12-28 01:20:03 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 2003-12-28 01:20:03 +0000 |
commit | bbe09cbe06f729e0a06e15b026b1ade56dce13af (patch) | |
tree | 114c3af040a49fd371e182844f014e4d59b976af /usr.bin | |
parent | f71dce4e637140c74c8880133b19f5a0bab93c5f (diff) | |
download | FreeBSD-src-bbe09cbe06f729e0a06e15b026b1ade56dce13af.zip FreeBSD-src-bbe09cbe06f729e0a06e15b026b1ade56dce13af.tar.gz |
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:
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/truss/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 <sys/param.h> #include <sys/ioctl.h> #include <sys/pioctl.h> +#include <sys/types.h> #include <sys/time.h> +#include <sys/resource.h> #include <err.h> #include <errno.h> @@ -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); } |