DolphinQt: Fix a -Wunused-result in gcc 11

Also use the correct error check for other similar calls in the same
file, despite nothing being doable on error.
This commit is contained in:
Emmanuel Gil Peyrot 2021-05-17 21:59:44 +02:00
parent 25b136ac17
commit 24db6e467a
1 changed files with 8 additions and 3 deletions

View File

@ -34,8 +34,9 @@ void SignalDaemon::OnNotifierActivated()
m_term->setEnabled(false); m_term->setEnabled(false);
char tmp; char tmp;
if (read(s_sigterm_fd[1], &tmp, sizeof(char))) if (read(s_sigterm_fd[1], &tmp, sizeof(char)) != sizeof(char))
{ {
// Not much we can do here.
} }
m_term->setEnabled(true); m_term->setEnabled(true);
@ -45,10 +46,14 @@ void SignalDaemon::OnNotifierActivated()
void SignalDaemon::HandleInterrupt(int) void SignalDaemon::HandleInterrupt(int)
{ {
write(STDERR_FILENO, message, sizeof(message)); if (write(STDERR_FILENO, message, sizeof(message)) != sizeof(message))
{
// Not much we can do here.
}
char a = 1; char a = 1;
if (write(s_sigterm_fd[0], &a, sizeof(a))) if (write(s_sigterm_fd[0], &a, sizeof(a)) != sizeof(a))
{ {
// Not much we can do here.
} }
} }