Skip to content

Commit

Permalink
remove duplicate names on merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSonnenschein committed Mar 8, 2011
1 parent c95d6e4 commit caecbc1
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions usr/src/uts/common/fs/lofs/lofs_vnops.c
Expand Up @@ -1160,10 +1160,23 @@ lo_readdir(

if (error != 0)
goto release;

error = uiomove(lbuf, lvec.iov_base - lbuf, UIO_READ, uiop);
if (error != 0)
goto release;

while(*lbuf != NULL) {
int found = 0;
caddr_t upper_dirs = ubuf;
while(*upper_dirs != NULL) {
if (!strcmp(((dirent_t*)lbuf)->d_name, ((dirent_t*)upper_dirs)->d_name)) {
found = 1;
break;
}
upper_dirs += sizeof(dirent_t);
}
if (!found)
error = uiomove(lbuf, sizeof(dirent_t), UIO_READ, uiop);
lbuf += sizeof(dirent_t);
if (error != 0)
goto release;
}

uiop->uio_loffset = l_uio.uio_loffset;

Expand Down

0 comments on commit caecbc1

Please sign in to comment.