소스 검색

st_blksize does only exist on 4.2 systems

ceriel 37 년 전
부모
커밋
8ebc170ec0
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      lang/cem/libcc/gen/opendir.c

+ 5 - 1
lang/cem/libcc/gen/opendir.c

@@ -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);