* Close directory stream opened by opendir() function. Close of the * directory stream invalidates the DIR structure as well as any previously * read directory entry. */
| 319 | * read directory entry. |
| 320 | */ |
| 321 | static int closedir(DIR *dirp) |
| 322 | { |
| 323 | if (dirp == NULL) { |
| 324 | /* invalid directory stream */ |
| 325 | DIRENT_SET_ERRNO (EBADF); |
| 326 | return -1; |
| 327 | } |
| 328 | |
| 329 | /* release search handle */ |
| 330 | if (dirp->search_handle != INVALID_HANDLE_VALUE) { |
| 331 | FindClose (dirp->search_handle); |
| 332 | dirp->search_handle = INVALID_HANDLE_VALUE; |
| 333 | } |
| 334 | |
| 335 | /* release directory structure */ |
| 336 | free (dirp); |
| 337 | return 0; |
| 338 | } |
| 339 | |
| 340 | |
| 341 | /***************************************************************************** |
nothing calls this directly
no outgoing calls
no test coverage detected