Skip to content
Snippets Groups Projects
Commit 153f6513 authored by Avi Kivity's avatar Avi Kivity
Browse files

file: make sys_open() allocate the file structure


Currently sys_open() receives an uninitialized file structure from its
callers, which is awkward as the callers must handle opening a file in
two steps.  It also doesn't fit well with C++'s notion of an object being
always fully initialized and valid.

Fix by making sys_open() allocate and return the file structure.  This also
fixes a window in open() where an fd would point to an uninitialized file
(between fdalloc() and sys_open()).

Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 989cf8ab
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment