diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-11 03:45:40 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-11 03:45:40 +0000 |
commit | 78e79022316f45e86a6cac4da85d6b60f5a8f7f8 (patch) | |
tree | 66190504e2f2d060b15712c54bb794d0f2a8b7e3 /test/test-segfault.c | |
parent | eb63ba5039c8afe61210cf2b217ec75b4a86356e (diff) | |
download | dbus-78e79022316f45e86a6cac4da85d6b60f5a8f7f8.tar.gz |
2003-04-10 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c (check_segfault_service_activation): add test
for launching an executable that just crashes.
* test/test-segfault.c (main): try setting coredumpsize to 0 so we
don't leave a million cores. We'll see how portable this is.
Diffstat (limited to 'test/test-segfault.c')
-rw-r--r-- | test/test-segfault.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test-segfault.c b/test/test-segfault.c index 6c197823..dad0b589 100644 --- a/test/test-segfault.c +++ b/test/test-segfault.c @@ -1,13 +1,22 @@ /* This is simply a process that segfaults */ #include <signal.h> +#include <sys/resource.h> + int main (int argc, char **argv) { - char *p = 0; + char *p; + + struct rlimit r = { 0, }; + + getrlimit (RLIMIT_CORE, &r); + r.rlim_cur = 0; + setrlimit (RLIMIT_CORE, &r); raise (SIGSEGV); + p = 0; *p = 'a'; return 0; |