file: redo locking

This commit is contained in:
Matheus
2023-07-03 22:51:53 -03:00
parent b657874c4c
commit 032560bda0
11 changed files with 107 additions and 27 deletions
+3 -2
View File
@@ -39,12 +39,13 @@ syscallret_t syscall_getdents(context_t *, int dirfd, void *ubuffer, size_t read
goto cleanup;
}
ret.errno = VOP_GETDENTS(fd->vnode, buffer, count, fd->offset, &ret.ret);
size_t offset = fd->offset;
ret.errno = VOP_GETDENTS(fd->vnode, buffer, count, offset, &ret.ret);
if (ret.errno)
goto cleanup;
fd->offset += ret.ret;
fd->offset = offset + ret.ret;
ret.ret *= sizeof(dent_t);