Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29988
Modified Files:
test_list.c
Log Message:
Fixed to reflect the new, proper, operation of getdirentries. Previously,
we were counting on the base pointer to getdirentries to return to zero
at EOF. That was erroneous. The only EOF check is the number of bytes
returned going to zero.
Aslo, fixed a bug. Hadn't wrapped the close.
Index: test_list.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -b -B -p -r1.10 -r1.11
--- test_list.c 4 Feb 2005 00:29:26 -0000 1.10
+++ test_list.c 4 Aug 2005 19:48:49 -0000 1.11
@@ -166,7 +166,6 @@ listit(const char *path)
goto out;
}
- base = 0;
while ((cc = SYSIO_INTERFACE_NAME(getdirentries)(fd,
(char *)buf,
n,
@@ -180,8 +179,6 @@ listit(const char *path)
cc -= dp->d_reclen;
dp = (struct dirent *)((char *)dp + dp->d_reclen);
}
- if (!base)
- break;
}
out:
@@ -192,7 +189,7 @@ out:
{
int oerrno = errno;
- if (close(fd) != 0) {
+ if (SYSIO_INTERFACE_NAME(close)(fd) != 0) {
perror(path);
if (cc < 0)
errno = oerrno;
|