Commit c14ff817 authored by Bhushan Shah's avatar Bhushan Shah 📱
Browse files

[core] send the dbus error if wakeup is invalid

This may happen when wrong cookie id is passed to clearWakeup.
parent 54a85ddf
......@@ -987,10 +987,14 @@ void Core::clearWakeup(int cookie)
}
// depending on cookie, remove it from scheduled wakeups
m_scheduledWakeups.erase(std::remove_if(m_scheduledWakeups.begin(), m_scheduledWakeups.end(), [cookie](WakeupInfo wakeup) {
auto erased = m_scheduledWakeups.erase(std::remove_if(m_scheduledWakeups.begin(), m_scheduledWakeups.end(), [cookie](WakeupInfo wakeup) {
return wakeup.cookie == cookie;
}));
if (erased == m_scheduledWakeups.end()) {
sendErrorReply(QDBusError::InvalidArgs, "Can not clear the invalid wakeup");
}
// reset timerfd
resetAndScheduleNextWakeup();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment