mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Kernel: Make Process::start_tracing_from API OOM safe
Modify the API so it's possible to propagate error on OOM failure. NonnullOwnPtr<T> is not appropriate for the ThreadTracer::create() API, so switch to OwnPtr<T>, use adopt_own_if_nonnull() to handle creation.
This commit is contained in:
committed by
Andreas Kling
parent
dba261f79b
commit
956314f0a1
@@ -660,9 +660,13 @@ void Process::set_tty(TTY* tty)
|
||||
m_tty = tty;
|
||||
}
|
||||
|
||||
void Process::start_tracing_from(ProcessID tracer)
|
||||
KResult Process::start_tracing_from(ProcessID tracer)
|
||||
{
|
||||
m_tracer = ThreadTracer::create(tracer);
|
||||
auto thread_tracer = ThreadTracer::create(tracer);
|
||||
if (!thread_tracer)
|
||||
return ENOMEM;
|
||||
m_tracer = move(thread_tracer);
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
void Process::stop_tracing()
|
||||
|
||||
Reference in New Issue
Block a user