1.1 --- a/tests/dstest_file_readdir.cc Tue Aug 10 23:41:57 2021 +0200
1.2 +++ b/tests/dstest_file_readdir.cc Wed Aug 11 00:51:09 2021 +0200
1.3 @@ -31,7 +31,7 @@
1.4
1.5
1.6
1.7 -static file_t *open_file(char *filename, bool have_uid, sys_uid_t uid)
1.8 +static file_t *open_directory(char *filename, bool have_uid, sys_uid_t uid)
1.9 {
1.10 /* With a user, open a user-specific file opener. */
1.11
1.12 @@ -47,25 +47,16 @@
1.13
1.14 /* Invoke the open method to receive the file reference. */
1.15
1.16 - return client_open_using(filename, O_DIRECTORY, opener);
1.17 + return client_opendir_using(filename, opener);
1.18 }
1.19 else
1.20 {
1.21 - return client_open(filename, O_DIRECTORY);
1.22 + return client_opendir(filename);
1.23 }
1.24 }
1.25
1.26
1.27
1.28 -static long open_directory(file_t *file)
1.29 -{
1.30 - /* Register the reader for notification. */
1.31 -
1.32 - return client_set_blocking(file, NOTIFY_CONTENT_AVAILABLE | NOTIFY_PEER_CLOSED);
1.33 -}
1.34 -
1.35 -
1.36 -
1.37 int main(int argc, char *argv[])
1.38 {
1.39 if (argc < 2)
1.40 @@ -77,7 +68,7 @@
1.41 char *filename = argv[1];
1.42 bool have_uid = (argc > 2) && strlen(argv[2]);
1.43 sys_uid_t uid = have_uid ? atoi(argv[2]) : 0;
1.44 - file_t *file = open_file(filename, have_uid, uid);
1.45 + file_t *file = open_directory(filename, have_uid, uid);
1.46
1.47 if (file == NULL)
1.48 {
1.49 @@ -85,14 +76,6 @@
1.50 return 1;
1.51 }
1.52
1.53 - long err = open_directory(file);
1.54 -
1.55 - if (err)
1.56 - {
1.57 - printf("Could not subscribe to notifications: %s\n", l4sys_errtostr(err));
1.58 - return 1;
1.59 - }
1.60 -
1.61 struct dirent *dirent;
1.62
1.63 while ((dirent = client_readdir(file)) != NULL)
1.64 @@ -105,7 +88,7 @@
1.65
1.66 /* Open again, reading a single entry only. */
1.67
1.68 - file = open_file(filename, have_uid, uid);
1.69 + file = open_directory(filename, have_uid, uid);
1.70
1.71 if (file == NULL)
1.72 {
1.73 @@ -113,14 +96,6 @@
1.74 return 1;
1.75 }
1.76
1.77 - err = open_directory(file);
1.78 -
1.79 - if (err)
1.80 - {
1.81 - printf("Could not subscribe to notifications: %s\n", l4sys_errtostr(err));
1.82 - return 1;
1.83 - }
1.84 -
1.85 dirent = client_readdir(file);
1.86
1.87 if (dirent != NULL)