From e41cd7290451ad18e161b4e619284b78f8fee863 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 23 Nov 2022 08:01:05 +0000 Subject: [PATCH] Neuter getrlimit dance, it's not portable enough. Stupid Windows. --- regress/lib/libcrypto/bn/general/bn_unit.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/regress/lib/libcrypto/bn/general/bn_unit.c b/regress/lib/libcrypto/bn/general/bn_unit.c index 06df91751ab..f1a2c780f79 100644 --- a/regress/lib/libcrypto/bn/general/bn_unit.c +++ b/regress/lib/libcrypto/bn/general/bn_unit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_unit.c,v 1.2 2022/11/22 09:09:43 tb Exp $ */ +/* $OpenBSD: bn_unit.c,v 1.3 2022/11/23 08:01:05 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include #include #include @@ -44,25 +42,17 @@ test_bn_print_wrapper(char *a, size_t size, const char *descr, static int test_bn_print_null_derefs(void) { - struct rlimit rlimit; size_t size = INT_MAX / 4 + 4; size_t datalimit = (size + 500 * 1024) / 1024; char *a; int failed = 0; - if (getrlimit(RLIMIT_DATA, &rlimit) != 0) - err(1, "getrlimit"); - - if ((rlimit.rlim_cur + 1023) / 1024 < datalimit) { - printf("%s: insufficient data limit. Need more than %zu KiB\n", - __func__, datalimit); - printf("SKIPPED\n"); + if ((a = malloc(size)) == NULL) { + warn("malloc(%zu) failed (make sure data limit is > %zu)", + size, datalimit); return 0; } - if ((a = malloc(size)) == NULL) - err(1, "malloc(%zu) failed", size); - memset(a, '0', size - 1); a[size - 1] = '\0'; -- 2.20.1