get rid of check for directory
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sat, 13 Nov 1982 11:48:19 +0000 (03:48 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sat, 13 Nov 1982 11:48:19 +0000 (03:48 -0800)
SCCS-vsn: lib/libc/gen/opendir.c 4.4

usr/src/lib/libc/gen/opendir.c

index 93e2d1e..e2ad197 100644 (file)
@@ -1,10 +1,9 @@
 /* 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>
 
 /*
  * open a directory.
 
 /*
  * open a directory.
@@ -15,13 +14,10 @@ opendir(name)
 {
        register DIR *dirp;
        register int fd;
 {
        register DIR *dirp;
        register int fd;
-       struct stat sbuf;
 
        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;
        }