kolibrios/contrib/sdk/sources/newlib/libc/posix/closedir.c
turbocat 75cc884573 NewLib:
Added missing dirent impl

git-svn-id: svn://kolibrios.org@9955 a494cfbc-eb01-0410-851d-a64ba20cac60
2024-01-12 23:03:49 +00:00

26 lines
394 B
C

/*
* Copyright (C) KolibriOS team 2024. All rights reserved.
* Distributed under terms of the GNU General Public License
*/
#include <dirent.h>
#include <errno.h>
#include <stdlib.h>
int
_DEFUN(closedir, (dirp),
register DIR *dirp)
{
if (!dirp)
{
errno = EBADF;
return -1;
}
if (dirp->path)
free(dirp->path);
free(dirp);
return 0;
}