From: otto Date: Wed, 27 Sep 2023 17:06:42 +0000 (+0000) Subject: We're not interested in the core dump, so prevent it. Also catch X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=92c6079fadf96e1babcde0781194afc3f678ff01;p=openbsd We're not interested in the core dump, so prevent it. Also catch SIGABRT, to avoid the "Abort trap" message, which confuses me sometimes until I realize it's the purpose of this test to abort. --- diff --git a/regress/lib/libc/malloc/malloc_threaderr/malloc_threaderr.c b/regress/lib/libc/malloc/malloc_threaderr/malloc_threaderr.c index f34f37fc938..3c38604ede5 100644 --- a/regress/lib/libc/malloc/malloc_threaderr/malloc_threaderr.c +++ b/regress/lib/libc/malloc/malloc_threaderr/malloc_threaderr.c @@ -15,9 +15,12 @@ */ #include +#include +#include #include #include -#include +#include +#include pthread_cond_t cond; pthread_mutex_t mutex; @@ -39,12 +42,23 @@ void *f(void *arg) return NULL; } +void +catch(int x) +{ + _exit(0); +} + int main(void) { + const struct rlimit lim = {0, 0}; pthread_t t1, t2; - printf("This test is supposed to print a malloc error and create a core dump\n"); + /* prevent coredumps */ + setrlimit(RLIMIT_CORE, &lim); + printf("This test is supposed to print a malloc error\n"); + + signal(SIGABRT, catch); if (pthread_create(&t1, NULL, m, NULL)) err(1, "pthread_create"); @@ -54,5 +68,5 @@ main(void) err(1, "pthread_create"); pthread_join(t2, NULL); - return 0; + return 1; }