ack/lang/cem/libcc/gen/closedir.c

16 lines
237 B
C
Raw Normal View History

1987-01-27 15:57:55 +00:00
#include <sys/types.h>
#include <sys/dir.h>
/*
* close a directory.
*/
closedir(dirp)
register DIR *dirp;
{
if (dirp->dd_fd >= 0) close(dirp->dd_fd);
1987-01-27 15:57:55 +00:00
dirp->dd_fd = -1;
dirp->dd_loc = -1;
1987-02-24 13:10:59 +00:00
free(dirp->dd_buf);
free((char *)dirp);
1987-01-27 15:57:55 +00:00
}