# HG changeset patch # User Paul Boddie # Date 1628119852 -7200 # Node ID d1490d96fd5860122534e4904ad5e03a5f4809a6 # Parent d54b90e3eef51e0066a51931a44c4f196667b087 Introduced testing of the pipe closure condition. diff -r d54b90e3eef5 -r d1490d96fd58 tests/dstest_host_readdir.cc --- a/tests/dstest_host_readdir.cc Thu Aug 05 01:29:59 2021 +0200 +++ b/tests/dstest_host_readdir.cc Thu Aug 05 01:30:52 2021 +0200 @@ -82,7 +82,7 @@ /* Register the reader for notification. */ - long err = client_set_blocking(file, NOTIFY_CONTENT_AVAILABLE); + long err = client_set_blocking(file, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED); if (err) { @@ -94,7 +94,7 @@ offset_t nread = client_read(file, buffer, DIRENT_CORE_SIZE); offset_t total = 0; - while (nread) + while (1) { total += nread; @@ -124,6 +124,9 @@ total = 0; } + if (file->notifications & NOTIFY_PEER_CLOSED) + break; + nread = client_read(file, buffer, DIRENT_CORE_SIZE); }