1.1 --- a/test_files/programs/ls.c Mon May 06 01:25:22 2024 +0200
1.2 +++ b/test_files/programs/ls.c Tue May 07 15:51:23 2024 +0200
1.3 @@ -75,7 +75,7 @@
1.4 static int _list_object(const char *path)
1.5 {
1.6 struct stat st;
1.7 - file_t *reader;
1.8 + DIR *dirp;
1.9 struct dirent *dirent;
1.10
1.11 if (client_stat(path, &st))
1.12 @@ -83,17 +83,14 @@
1.13
1.14 if (S_ISDIR(st.st_mode))
1.15 {
1.16 - reader = client_opendir(path);
1.17 + dirp = opendir(path);
1.18
1.19 - if (!client_opened(reader))
1.20 - {
1.21 - client_close(reader);
1.22 + if (dirp == NULL)
1.23 return 1;
1.24 - }
1.25
1.26 /* Show the directory entries. */
1.27
1.28 - while ((dirent = client_readdir(reader)) != NULL)
1.29 + while ((dirent = readdir(dirp)) != NULL)
1.30 {
1.31 if (_show_dirent(path, dirent))
1.32 {
1.33 @@ -104,7 +101,7 @@
1.34 free(dirent);
1.35 }
1.36
1.37 - client_close(reader);
1.38 + closedir(dirp);
1.39 }
1.40 else
1.41 _show_object(path_basename(path), &st);