diff options
| author | Bryan C. Mills <bcmills@google.com> | 2022-01-07 09:54:44 -0500 |
|---|---|---|
| committer | Bryan Mills <bcmills@google.com> | 2022-01-07 21:15:14 +0000 |
| commit | be26ca972d2149df09e70789fdf284da01c5e9d8 (patch) | |
| tree | 55032574b7b6c37cf887fb1cb17fffce81cfb1c0 /test/typeparam | |
| parent | f1596d76f488e4d82d217418df4191f34b71d117 (diff) | |
| download | go-be26ca972d2149df09e70789fdf284da01c5e9d8.tar.xz | |
syscall: in TestDirent, make as many ReadDirent calls as are needed
ReadDirent returns only as many directory entries as will fit in the
buffer, and each entry is variable-length — so we have no guarantee in
general that a buffer of a given arbitrary size can hold even one
entry, let alone all ten entries expected by the test.
Instead, iterate calls to ReadDirent until one of the calls returns
zero entries and no error, indicating that the directory has been read
to completion.
Fixes #37323
Change-Id: I7f1cedde7666107256604e4ea1ac13c71f22151a
Reviewed-on: https://go-review.googlesource.com/c/go/+/376334
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/typeparam')
0 files changed, 0 insertions, 0 deletions
