1.1 --- a/tests/dstest_pipe_client.cc Wed Jul 07 00:27:27 2021 +0200
1.2 +++ b/tests/dstest_pipe_client.cc Wed Jul 07 00:28:19 2021 +0200
1.3 @@ -122,13 +122,6 @@
1.4 printf("Pipe #%d notified with conditions:%s%s\n", p, reader->notifications & NOTIFY_PEER_CLOSED ? " closed" : "",
1.5 reader->notifications & NOTIFY_CONTENT_AVAILABLE ? " content" : "");
1.6
1.7 - if (reader->notifications & NOTIFY_PEER_CLOSED)
1.8 - {
1.9 - active--;
1.10 - if (!active)
1.11 - break;
1.12 - }
1.13 -
1.14 nread = client_read(reader, buffer, size);
1.15
1.16 while (nread)
1.17 @@ -145,6 +138,16 @@
1.18 #endif
1.19 nread = client_read(reader, buffer, size);
1.20 }
1.21 +
1.22 + /* Without any more content, a peer closed event should terminate reading
1.23 + from the pipe. */
1.24 +
1.25 + if (reader->notifications & NOTIFY_PEER_CLOSED)
1.26 + {
1.27 + active--;
1.28 + if (!active)
1.29 + break;
1.30 + }
1.31 }
1.32
1.33 printf("Data shown.\n");