scripts: pre-submit: Limit file descriptors for valgrind
Valgrind complains and exits with an error if the limit is "too large":
--426:0:libcfile Valgrind: FATAL: Private file creation failed.
The current file descriptor limit is 1073741804.
If you are running in Docker please consider
lowering this limit with the shell built-in limit command.
--426:0:libcfile Exiting now.
Change-Id: I8b58f0c17ae3e22a11f1678e171c3ee54dc432c3
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/scripts/pre-submit b/scripts/pre-submit
index b8f3fb9..7fd3dd2 100755
--- a/scripts/pre-submit
+++ b/scripts/pre-submit
@@ -1,6 +1,9 @@
#!/usr/bin/sh
set -eu
+# For valgrind, value is arbitrarily low-ish
+ulimit -n 2048
+
BUILD="$(mktemp --directory --tmpdir=.)"
trap 'rm -rf "$BUILD"' EXIT