From bbe7ae21e8e5cb1515d63f68ba69c80745125ec2 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 28 Jul 1988 09:26:22 +0000 Subject: [PATCH] BSD4.[23] could also run NFS --- lang/cem/libcc/gen/opendir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cem/libcc/gen/opendir.c b/lang/cem/libcc/gen/opendir.c index 82db49b36..b7dff663c 100644 --- a/lang/cem/libcc/gen/opendir.c +++ b/lang/cem/libcc/gen/opendir.c @@ -32,20 +32,20 @@ char *name; if ((unsigned) siz == siz && (dirp->dd_buf = malloc((unsigned) siz))) { dirp->dd_bsize = siz; -#ifdef sun +#ifdef __BSD4_2 dirp->dd_size = getdirentries(fd, (char *) dirp->dd_buf, (int) siz, &siz); -#else - dirp->dd_size = read(fd, dirp->dd_buf, dirp->dd_bsize); + if (dirp->dd_size < 0 ) #endif + dirp->dd_size = read(fd, dirp->dd_buf, dirp->dd_bsize); close(fd); dirp->dd_fd = -2; dirp->dd_loc = 0; return dirp; } -#ifndef sun +#ifndef __BSD4_2 else if (dirp->dd_buf = malloc(8*DIRBLKSIZ)) { dirp->dd_bsize = 8 * DIRBLKSIZ; } -- 2.34.1