Commit 8083a3e50895abb6070d9f339363d05d2c5e0017

Authored by bellard
1 parent 644c433c

dirent fixes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@48 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 4 deletions
linux-user/syscall.c
... ... @@ -1603,10 +1603,10 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1603 1603 int reclen;
1604 1604 de = dirp;
1605 1605 while (len > 0) {
1606   - reclen = tswap16(de->d_reclen);
  1606 + reclen = de->d_reclen;
1607 1607 if (reclen > len)
1608 1608 break;
1609   - de->d_reclen = reclen;
  1609 + de->d_reclen = tswap16(reclen);
1610 1610 tswapls(&de->d_ino);
1611 1611 tswapls(&de->d_off);
1612 1612 de = (struct dirent *)((char *)de + reclen);
... ... @@ -1626,10 +1626,10 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1626 1626 int reclen;
1627 1627 de = dirp;
1628 1628 while (len > 0) {
1629   - reclen = tswap16(de->d_reclen);
  1629 + reclen = de->d_reclen;
1630 1630 if (reclen > len)
1631 1631 break;
1632   - de->d_reclen = reclen;
  1632 + de->d_reclen = tswap16(reclen);
1633 1633 tswap64s(&de->d_ino);
1634 1634 tswap64s(&de->d_off);
1635 1635 de = (struct dirent64 *)((char *)de + reclen);
... ...