summaryrefslogtreecommitdiff
path: root/usr.bin/sort/sort.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2015-04-02 21:04:07 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2015-04-02 21:04:07 +0000
commit64ee1cd4a192376e6745215bef44b3ea6d27cd5a (patch)
treef1202d460e252404cb6b8ed58f5eddd7682bebe5 /usr.bin/sort/sort.c
parent52f47df93eb084f158fd9bc0d4e05c50b862c070 (diff)
Global variable free_memory is only used in sort.c's set_hw_params,
so turn it into a local one. ok millert@
Diffstat (limited to 'usr.bin/sort/sort.c')
-rw-r--r--usr.bin/sort/sort.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index 01b8e114ba1..a6d07cdbe59 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.72 2015/04/02 21:00:08 tobias Exp $ */
+/* $OpenBSD: sort.c,v 1.73 2015/04/02 21:04:06 tobias Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -200,6 +200,7 @@ read_fns_from_file0(const char *fn)
static void
set_hw_params(void)
{
+ unsigned long long free_memory;
long long user_memory;
struct rlimit rl;
size_t len;
@@ -219,8 +220,10 @@ set_hw_params(void)
} else {
warn("Can't set resource limit to max data size");
}
- } else
+ } else {
+ free_memory = 1000000;
warn("Can't get resource limit for data size");
+ }
/* We prefer to use temp files rather than swap space. */
if (user_memory != -1 && free_memory > user_memory)