1.1 --- a/tests/dstest_host_readdir.cc Thu Aug 05 01:29:59 2021 +0200
1.2 +++ b/tests/dstest_host_readdir.cc Thu Aug 05 01:30:52 2021 +0200
1.3 @@ -82,7 +82,7 @@
1.4
1.5 /* Register the reader for notification. */
1.6
1.7 - long err = client_set_blocking(file, NOTIFY_CONTENT_AVAILABLE);
1.8 + long err = client_set_blocking(file, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED);
1.9
1.10 if (err)
1.11 {
1.12 @@ -94,7 +94,7 @@
1.13 offset_t nread = client_read(file, buffer, DIRENT_CORE_SIZE);
1.14 offset_t total = 0;
1.15
1.16 - while (nread)
1.17 + while (1)
1.18 {
1.19 total += nread;
1.20
1.21 @@ -124,6 +124,9 @@
1.22 total = 0;
1.23 }
1.24
1.25 + if (file->notifications & NOTIFY_PEER_CLOSED)
1.26 + break;
1.27 +
1.28 nread = client_read(file, buffer, DIRENT_CORE_SIZE);
1.29 }
1.30