[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2004-09-10 16:43:15
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14110 Modified Files: fs_native.c Log Message: work around for basep brokenness Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -w -b -B -p -r1.47 -r1.48 --- fs_native.c 25 Aug 2004 08:07:45 -0000 1.47 +++ fs_native.c 10 Sep 2004 16:42:39 -0000 1.48 @@ -1022,6 +1022,12 @@ native_getdirentries(struct inode *ino, struct dirent64 *d64p; size_t namlen; size_t reclen; + /* + * Work-around for broken 64 bit basep update + * Get value of basep to return from last directory + * entry d_off value + */ + _SYSIO_OFF_T last_offset = *basep; #else #define bp buf #define count nbytes @@ -1068,12 +1074,15 @@ native_getdirentries(struct inode *ino, cc -= ldp->ld_reclen; ldp = (struct linux_dirent *)((char *)ldp + ldp->ld_reclen); nbytes -= d64p->d_reclen; + last_offset = d64p->d_off; d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); } + nino->ni_fpos = *basep = last_offset; free(bp); - if (d64p == (struct dirent64 *)buf && cc) - cc = -EINVAL; /* buf too small */ - cc = (char *)d64p - buf; + cc = + (d64p == (struct dirent64 *)buf && cc) + ? -EINVAL + : (char *)d64p - buf; #else #undef bp #undef count |