mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Kernel: Tidy up Coredump construction
- Use KResultOr and TRY to propagate errors - Return more specific errors now that they have a path out from here
This commit is contained in:
parent
c11c0fe453
commit
60eea6940f
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/awesomekling
Commit: 60eea6940f
3 changed files with 26 additions and 39 deletions
|
@ -553,10 +553,10 @@ bool Process::dump_core()
|
|||
VERIFY(should_generate_coredump());
|
||||
dbgln("Generating coredump for pid: {}", pid().value());
|
||||
auto coredump_path = String::formatted("/tmp/coredump/{}_{}_{}", name(), pid().value(), kgettimeofday().to_truncated_seconds());
|
||||
auto coredump = Coredump::create(*this, coredump_path);
|
||||
if (!coredump)
|
||||
auto coredump_or_error = Coredump::try_create(*this, coredump_path);
|
||||
if (coredump_or_error.is_error())
|
||||
return false;
|
||||
return !coredump->write().is_error();
|
||||
return !coredump_or_error.value()->write().is_error();
|
||||
}
|
||||
|
||||
bool Process::dump_perfcore()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue