From 9348edb6b650db58a501e4e26e5dbf8e8b13e84d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 27 Aug 2023 20:49:33 -0700 Subject: [PATCH] sort: port sort-merge-fdlimit test to Solaris 10 * tests/sort/sort-merge-fdlimit.sh: Give 'sort' fd 6 too. Needed for the same reason sort-continue.sh needed a ulimit -n boost. --- tests/sort/sort-merge-fdlimit.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sort/sort-merge-fdlimit.sh b/tests/sort/sort-merge-fdlimit.sh index db2d8ebf09..7dda7f8f5e 100755 --- a/tests/sort/sort-merge-fdlimit.sh +++ b/tests/sort/sort-merge-fdlimit.sh @@ -61,9 +61,16 @@ done # This test finds the bug only with shells that do not close FDs on # exec, and will miss the bug (if present) on other shells, but it's # not easy to fix this without running afoul of the OpenBSD-like sh bugs. +# +# This script uses 'ulimit -n 10' with 7, 8 and 9 open +# to limit 'sort' to at most 7 open files: +# stdin, stdout, stderr, two input and one output files when merging, +# and an extra. The extra is for old-fashioned platforms like Solaris 10 +# where opening a temp file also requires opening /dev/urandom to +# calculate the temp file's name. (seq 6 && echo 6) >exp || framework_failure_ echo 6 >out || framework_failure_ -(exec 3<&- 4<&- 5<&- 6