st_blksize does only exist on 4.2 systems
This commit is contained in:
parent
a71813b911
commit
8ebc170ec0
|
@ -15,10 +15,14 @@ char *name;
|
||||||
long siz;
|
long siz;
|
||||||
extern char *malloc();
|
extern char *malloc();
|
||||||
|
|
||||||
|
#ifdef __BSD4_2
|
||||||
|
siz = stbuf.st_blksize;
|
||||||
|
#else
|
||||||
|
siz = DIRBLKSIZ;
|
||||||
|
#endif
|
||||||
if ((fd = open(name, 0)) == -1)
|
if ((fd = open(name, 0)) == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
fstat(fd, &stbuf);
|
fstat(fd, &stbuf);
|
||||||
siz = stbuf.st_blksize;
|
|
||||||
if (((stbuf.st_mode & S_IFDIR) == 0) ||
|
if (((stbuf.st_mode & S_IFDIR) == 0) ||
|
||||||
((dirp = (DIR *)malloc(sizeof (DIR))) == NULL)) {
|
((dirp = (DIR *)malloc(sizeof (DIR))) == NULL)) {
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
Loading…
Reference in a new issue