Skip to content

Commit

Permalink
Prevent the DUT from getting killed with the signal to trigger the ev…
Browse files Browse the repository at this point in the history
…ent (#15004)
  • Loading branch information
yufengwangca authored and pull[bot] committed Jul 27, 2023
1 parent ccd2be5 commit 2358018
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/platform/Linux/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,39 +74,39 @@ void SignalHandler(int signum)
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::SoftwareReset);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGHUP:
case SIGALRM:
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::BrownOutReset);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGTERM:
case SIGVTALRM:
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::PowerOnReboot);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGUSR1:
case SIGTRAP:
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::HardwareWatchdogReset);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGUSR2:
case SIGILL:
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::SoftwareWatchdogReset);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGTSTP:
case SIGIO:
ConfigurationMgr().StoreBootReason(DiagnosticDataProvider::BootReasonType::SoftwareUpdateCompleted);
err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED;
break;
case SIGTRAP:
case SIGUSR1:
PlatformMgrImpl().HandleSoftwareFault(SoftwareDiagnostics::Events::SoftwareFault::Id);
break;
case SIGILL:
case SIGUSR2:
PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::HardwareFaultChange::Id);
break;
case SIGALRM:
case SIGHUP:
PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::RadioFaultChange::Id);
break;
case SIGVTALRM:
case SIGTERM:
PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::Id);
break;
case SIGIO:
case SIGTSTP:
PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::Id);
break;
default:
Expand Down

0 comments on commit 2358018

Please sign in to comment.