st_blksize does only exist on 4.2 systems
authorceriel <none@none>
Tue, 7 Apr 1987 08:46:15 +0000 (08:46 +0000)
committerceriel <none@none>
Tue, 7 Apr 1987 08:46:15 +0000 (08:46 +0000)
lang/cem/libcc/gen/opendir.c

index 28f3de3..82db49b 100644 (file)
@@ -15,10 +15,14 @@ char *name;
        long siz;
        extern char *malloc();
 
+#ifdef __BSD4_2
+       siz = stbuf.st_blksize;
+#else
+       siz = DIRBLKSIZ;
+#endif
        if ((fd = open(name, 0)) == -1)
                return NULL;
        fstat(fd, &stbuf);
-       siz = stbuf.st_blksize;
        if (((stbuf.st_mode & S_IFDIR) == 0) ||
            ((dirp = (DIR *)malloc(sizeof (DIR))) == NULL)) {
                close (fd);