1.1 --- a/tests/dstest_pipe_client.cc Sat Aug 21 19:28:08 2021 +0200
1.2 +++ b/tests/dstest_pipe_client.cc Sun Aug 22 22:37:55 2021 +0200
1.3 @@ -78,10 +78,14 @@
1.4 long err;
1.5 file_t *reader;
1.6
1.7 + /* Use a local notifier to wait for pipe events. */
1.8 +
1.9 + file_notifier_t *notifier = client_notifier_local();
1.10 +
1.11 /* Register the readers for notification. */
1.12
1.13 - if ((err = client_subscribe(reader1, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED, NOTIFIER_THREAD)) ||
1.14 - (err = client_subscribe(reader2, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED, NOTIFIER_THREAD)))
1.15 + if ((err = client_subscribe(reader1, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED, notifier)) ||
1.16 + (err = client_subscribe(reader2, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED, notifier)))
1.17 {
1.18 printf("Could not subscribe to notifications: %s\n", l4sys_errtostr(err));
1.19 return;
1.20 @@ -94,11 +98,12 @@
1.21
1.22 /* Wait for notification of content. */
1.23
1.24 - err = client_wait_files(&reader);
1.25 + err = client_wait_files(&reader, notifier);
1.26
1.27 if (err)
1.28 {
1.29 printf("Error waiting for notifications: %s\n", l4sys_errtostr(err));
1.30 + client_notifier_close(notifier);
1.31 return;
1.32 }
1.33
1.34 @@ -143,6 +148,7 @@
1.35
1.36 client_close(reader1);
1.37 client_close(reader2);
1.38 + client_notifier_close(notifier);
1.39
1.40 printf("Data shown.\n");
1.41 }