mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-26 08:51:08 +00:00
libc: update seek state on opening O_APPEND fds
If a fd is opened in append mode and just is to be used (so never written by the parent component) for the to be forked child, the seek state was not pointing to the end of the file. The wrong seek value then was used in File_descriptor_allocator::generate_info(). Issue #3991
This commit is contained in:
parent
5fa91c573b
commit
9d239957bc
@ -555,6 +555,9 @@ __SYS_(int, open, (const char *pathname, int flags, ...),
|
||||
return -1;
|
||||
new_fdo->path(resolved_path.base());
|
||||
|
||||
if (flags & O_APPEND)
|
||||
lseek(new_fdo->libc_fd, 0, SEEK_END);
|
||||
|
||||
return new_fdo->libc_fd;
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user