mirror of
https://github.com/coreutils/coreutils.git
synced 2026-10-28 09:44:34 +08:00
tests: sort: avoid a failure on GNU/Hurd
On GNU/Hurd, file descriptor limits set via 'ulimit -n' seem to be
ineffective when set below the default:
$ (ulimit -n; ulimit -n 512; ulimit -n; \
tee $(seq 1024) < /dev/null; echo $?)
1024
512
tee: 1022: Too many open files
tee: 1023: Too many open files
tee: 1024: Too many open files
1
* tests/sort/sort-merge-fdlimit.sh: Don't fail if using 'ulimit -n' to
decrease the file descriptor limit is ineffective.
This commit is contained in:
1 parent
1859316a9f
commit
9e4b42982a
1 file changed
+5
-1
@@ -35,7 +35,11 @@ seq 17 >some-data
|
||||
# the ATF but fail inside it.
|
||||
|
||||
(ulimit -n 19 && touch ulimit-worked &&
|
||||
returns_ 2 sort --batch-size=20 /dev/null) || fail=1
|
||||
returns_ 2 sort --batch-size=20 /dev/null) || {
|
||||
# GNU/Hurd seems to ignore 'ulimit -n'. Check for that
|
||||
# before failing.
|
||||
(ulimit -n 0; cat /dev/null) || fail=1
|
||||
}
|
||||
rm ulimit-worked || skip_ 'cannot modify open file descriptor limit'
|
||||
|
||||
# The default batch size (nmerge) is 16.
|
||||
|
||||
Reference in new issue
Block a user