Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright (C) KolibriOS team 2024. All rights reserved.
  3.  * Distributed under terms of the GNU General Public License
  4. */
  5.  
  6. #include <dirent.h>
  7. #include <errno.h>
  8. #include <stdlib.h>
  9.  
  10. int
  11. _DEFUN(closedir, (dirp),
  12.        register DIR *dirp)
  13. {
  14.     if (!dirp)
  15.     {
  16.         errno = EBADF;
  17.         return -1;
  18.     }
  19.  
  20.     if (dirp->path)
  21.         free(dirp->path);
  22.  
  23.     free(dirp);
  24.     return 0;
  25. }
  26.