mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03:00
LibWasm: Keep track of created directory fds in path_create_directory
This commit is contained in:
parent
5121b368cd
commit
47248a3511
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/47248a3511 Pull-request: https://github.com/SerenityOS/serenity/pull/18650 Reviewed-by: https://github.com/gmta
@ -478,6 +478,10 @@
|
||||
# cmakedefine01 WASI_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WASI_FINE_GRAINED_DEBUG
|
||||
# cmakedefine01 WASI_FINE_GRAINED_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WASM_BINPARSER_DEBUG
|
||||
# cmakedefine01 WASM_BINPARSER_DEBUG
|
||||
#endif
|
||||
|
@ -197,6 +197,7 @@ set(VPX_DEBUG ON)
|
||||
set(WAITBLOCK_DEBUG ON)
|
||||
set(WAITQUEUE_DEBUG ON)
|
||||
set(WASI_DEBUG ON)
|
||||
set(WASI_FINE_GRAINED_DEBUG ON)
|
||||
set(WASM_BINPARSER_DEBUG ON)
|
||||
set(WASM_TRACE_DEBUG ON)
|
||||
set(WASM_VALIDATOR_DEBUG ON)
|
||||
|
@ -636,12 +636,16 @@ ErrorOr<Result<FD>> Implementation::impl$path_open(Configuration& configuration,
|
||||
auto path_data = TRY(slice_typed_memory(configuration, path, path_len));
|
||||
auto path_string = DeprecatedString::copy(path_data);
|
||||
|
||||
dbgln_if(WASI_FINE_GRAINED_DEBUG, "path_open: dir_fd={}, path={}, open_flags={}", dir_fd, path_string, open_flags);
|
||||
|
||||
int opened_fd = openat(dir_fd, path_string.characters(), open_flags, 0644);
|
||||
if (opened_fd < 0)
|
||||
return errno_value_from_errno(errno);
|
||||
|
||||
// FIXME: Implement Rights and RightsInheriting.
|
||||
|
||||
m_fd_map.insert(opened_fd, static_cast<u32>(opened_fd));
|
||||
|
||||
return FD(opened_fd);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user