[Libsysio-commit] HEAD: libsysio/src getdirentries.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-05-25 17:53:54
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19311/src Modified Files: getdirentries.c Log Message: +Changes for Red Storm from Kevin Pedretti +Fix in fs_native.c to conditionally compile DIR_STREAMED code properly. We were always including it -- Even when using getdirentries. Oops. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- getdirentries.c 28 Apr 2004 21:15:58 -0000 1.14 +++ getdirentries.c 25 May 2004 17:53:43 -0000 1.15 @@ -109,7 +109,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren buf, nbytes, basep); - SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, (int )cc); + SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } #if _LARGEFILE64_SOURCE @@ -156,7 +156,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int _SYSIO_OFF_T ibase; ssize_t cc; struct dirent *dp, *nxtdp; -#if defined(BSD) || defined(REDSTORM) +#if defined(BSD) int off; #endif struct intnl_dirent *od64p, *d64p; @@ -176,16 +176,16 @@ SYSIO_INTERFACE_NAME(getdirentries)(int _rndup(_dbaselen + (namlen) + 1, sizeof(int)) #endif -#if defined(__GLIBC__) && !(defined(REDSTORM)) +#if defined(__GLIBC__) #define _fast_alloc(n) alloca(n) #define _fast_free(p) -#else /* !defined(__GLIBC__) || defined(REDSTORM) */ +#else /* !defined(__GLIBC__) */ #define _fast_alloc(n) malloc(n) #define _fast_free(p) free(p) #endif SYSIO_INTERFACE_ENTER; -#if defined(BSD) || defined(REDSTORM) +#if defined(BSD) if (nbytes < 0) SYSIO_INTERFACE_RETURN(-1, -EINVAL); #endif @@ -219,7 +219,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int goto out; } -#if defined(BSD) || defined(REDSTORM) +#if defined(BSD) off = *basep; #endif od64p = NULL; @@ -236,13 +236,13 @@ SYSIO_INTERFACE_NAME(getdirentries)(int if (reclen >= (unsigned )nbytes) break; dp->d_ino = (ino_t )d64p->d_ino; -#if !(defined(BSD) || defined(REDSTORM)) +#if !(defined(BSD)) dp->d_off = (off_t )d64p->d_off; #endif if ((sizeof(dp->d_ino) != sizeof(d64p->d_ino) && dp->d_ino != d64p->d_ino) || -#if !(defined(BSD) || defined(REDSTORM)) +#if !(defined(BSD)) (sizeof(dp->d_off) != sizeof(d64p->d_off) && dp->d_off != d64p->d_off) #else @@ -262,7 +262,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int od64p = d64p; d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); nbytes -= reclen; -#if defined(BSD) || defined(REDSTORM) +#if defined(BSD) off += reclen; #endif dp = nxtdp; @@ -276,7 +276,7 @@ out: cc = (char *)dp - buf; if (cc) *basep = -#if !(defined(BSD) || defined(REDSTORM)) +#if !(defined(BSD)) od64p->d_off; #else off; |