mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Suppress remaining unobserved KResult return codes
These are all cases where there is no clear and easy fix, I've left FIXME bread crumbs so that these can hopefully be fixed over time.
This commit is contained in:
parent
d67069d922
commit
946c96dd56
Notes:
sideshowbarker
2024-07-19 04:16:53 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/946c96dd569 Pull-request: https://github.com/SerenityOS/serenity/pull/3001 Reviewed-by: https://github.com/awesomekling
7 changed files with 23 additions and 15 deletions
|
@ -1477,11 +1477,13 @@ void Ext2FSInode::populate_lookup_cache() const
|
|||
return;
|
||||
HashMap<String, unsigned> children;
|
||||
|
||||
traverse_as_directory([&children](auto& entry) {
|
||||
KResult result = traverse_as_directory([&children](auto& entry) {
|
||||
children.set(String(entry.name, entry.name_length), entry.inode.index());
|
||||
return true;
|
||||
});
|
||||
|
||||
ASSERT(result.is_success());
|
||||
|
||||
if (!m_lookup_cache.is_empty())
|
||||
return;
|
||||
m_lookup_cache = move(children);
|
||||
|
|
|
@ -70,7 +70,8 @@ FileDescription::~FileDescription()
|
|||
socket()->detach(*this);
|
||||
if (is_fifo())
|
||||
static_cast<FIFO*>(m_file.ptr())->detach(m_fifo_direction);
|
||||
m_file->close();
|
||||
// FIXME: Should this error path be observed somehow?
|
||||
(void)m_file->close();
|
||||
m_inode = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -636,7 +636,8 @@ Plan9FSInode::~Plan9FSInode()
|
|||
{
|
||||
Plan9FS::Message clunk_request { fs(), Plan9FS::Message::Type::Tclunk };
|
||||
clunk_request << fid();
|
||||
fs().post_message_and_explicitly_ignore_reply(clunk_request);
|
||||
// FIXME: Should we observe this error somehow?
|
||||
(void)fs().post_message_and_explicitly_ignore_reply(clunk_request);
|
||||
}
|
||||
|
||||
KResult Plan9FSInode::ensure_open_for_mode(int mode)
|
||||
|
@ -829,7 +830,8 @@ KResult Plan9FSInode::traverse_as_directory(Function<bool(const FS::DirectoryEnt
|
|||
if (result.is_error()) {
|
||||
Plan9FS::Message close_message { fs(), Plan9FS::Message::Type::Tclunk };
|
||||
close_message << clone_fid;
|
||||
fs().post_message_and_explicitly_ignore_reply(close_message);
|
||||
// FIXME: Should we observe this error?
|
||||
(void)fs().post_message_and_explicitly_ignore_reply(close_message);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -871,7 +873,8 @@ KResult Plan9FSInode::traverse_as_directory(Function<bool(const FS::DirectoryEnt
|
|||
|
||||
Plan9FS::Message close_message { fs(), Plan9FS::Message::Type::Tclunk };
|
||||
close_message << clone_fid;
|
||||
fs().post_message_and_explicitly_ignore_reply(close_message);
|
||||
// FIXME: Should we observe this error?
|
||||
(void)fs().post_message_and_explicitly_ignore_reply(close_message);
|
||||
return result;
|
||||
} else {
|
||||
// TODO
|
||||
|
|
|
@ -138,7 +138,8 @@ void TCPSocket::release_for_accept(RefPtr<TCPSocket> socket)
|
|||
{
|
||||
ASSERT(m_pending_release_for_accept.contains(socket->tuple()));
|
||||
m_pending_release_for_accept.remove(socket->tuple());
|
||||
queue_connection_from(*socket);
|
||||
// FIXME: Should we observe this error somehow?
|
||||
(void)queue_connection_from(*socket);
|
||||
}
|
||||
|
||||
TCPSocket::TCPSocket(int protocol)
|
||||
|
|
|
@ -384,7 +384,8 @@ bool Scheduler::pick_next()
|
|||
}
|
||||
if (process.m_alarm_deadline && g_uptime > process.m_alarm_deadline) {
|
||||
process.m_alarm_deadline = 0;
|
||||
process.send_signal(SIGALRM, nullptr);
|
||||
// FIXME: Should we observe this signal somehow?
|
||||
(void)process.send_signal(SIGALRM, nullptr);
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
|
|
@ -246,7 +246,8 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
|||
for (size_t i = 0; i < m_fds.size(); ++i) {
|
||||
auto& description_and_flags = m_fds[i];
|
||||
if (description_and_flags.description() && description_and_flags.flags() & FD_CLOEXEC) {
|
||||
description_and_flags.description()->close();
|
||||
// FIXME: Should this error path be observed somehow?
|
||||
(void)description_and_flags.description()->close();
|
||||
description_and_flags = {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,9 +55,8 @@ void TTY::set_default_termios()
|
|||
KResultOr<size_t> TTY::read(FileDescription&, size_t, u8* buffer, size_t size)
|
||||
{
|
||||
if (Process::current()->pgid() != pgid()) {
|
||||
KResult result = Process::current()->send_signal(SIGTTIN, nullptr);
|
||||
if (result.is_error())
|
||||
return result;
|
||||
// FIXME: Should we propigate this error path somehow?
|
||||
(void)Process::current()->send_signal(SIGTTIN, nullptr);
|
||||
return KResult(-EINTR);
|
||||
}
|
||||
|
||||
|
@ -93,9 +92,8 @@ KResultOr<size_t> TTY::read(FileDescription&, size_t, u8* buffer, size_t size)
|
|||
KResultOr<size_t> TTY::write(FileDescription&, size_t, const u8* buffer, size_t size)
|
||||
{
|
||||
if (Process::current()->pgid() != pgid()) {
|
||||
KResult result = Process::current()->send_signal(SIGTTOU, nullptr);
|
||||
if (result.is_error())
|
||||
return result;
|
||||
// FIXME: Should we propigate this error path somehow?
|
||||
(void)Process::current()->send_signal(SIGTTOU, nullptr);
|
||||
return KResult(-EINTR);
|
||||
}
|
||||
|
||||
|
@ -255,7 +253,8 @@ void TTY::generate_signal(int signal)
|
|||
InterruptDisabler disabler; // FIXME: Iterate over a set of process handles instead?
|
||||
Process::for_each_in_pgrp(pgid(), [&](auto& process) {
|
||||
dbg() << tty_name() << ": Send signal " << signal << " to " << process;
|
||||
process.send_signal(signal, nullptr);
|
||||
// FIXME: Should this error be propagated somehow?
|
||||
(void)process.send_signal(signal, nullptr);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue