SCCS-vsn: lib/libc/gen/opendir.c 4.4
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)opendir.c 4.3 %G%";
+static char sccsid[] = "@(#)opendir.c 4.4 %G%";
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ndir.h>
+#include <sys/param.h>
+#include <dir.h>
{
register DIR *dirp;
register int fd;
{
register DIR *dirp;
register int fd;
if ((fd = open(name, 0)) == -1)
return NULL;
if ((fd = open(name, 0)) == -1)
return NULL;
- fstat(fd, &sbuf);
- if (((sbuf.st_mode & S_IFDIR) == 0) ||
- ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL)) {
+ if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
close (fd);
return NULL;
}
close (fd);
return NULL;
}