Пример #1
0
TEST(fdopendir, empty) {
  DIR *dirp = fdopendir(fd_tmp);
  ASSERT_NE(NULL, dirp);

  // We should see exactly two directory entries. The order may differ.
  struct dirent *de = readdir(dirp);
  if (strcmp(".", de->d_name) == 0) {
    test_dot(fd_tmp, de);
    de = readdir(dirp);
    test_dotdot(de);
  } else {
    test_dotdot(de);
    de = readdir(dirp);
    test_dot(fd_tmp, de);
  }

  ASSERT_EQ(NULL, readdir(dirp));
  ASSERT_EQ(fd_tmp, fdclosedir(dirp));
}
Пример #2
0
int
closedir(DIR *dirp)
{

	return (_close(fdclosedir(dirp)));
}