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:
Brian Gianforcaro 2020-08-05 02:13:30 -07:00 committed by Andreas Kling
parent d67069d922
commit 946c96dd56
Notes: sideshowbarker 2024-07-19 04:16:53 +09:00
7 changed files with 23 additions and 15 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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

View file

@ -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)

View file

@ -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;
});

View file

@ -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 = {};
}
}

View file

@ -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;
});
}