mirror of
https://gitee.com/openharmony/startup_init
synced 2025-02-22 21:41:48 +00:00
Don't trigger Panic by services exceptions in rescue mode!
Signed-off-by: shaojiequ <qushaojie2@huawei.com>
This commit is contained in:
parent
415968c693
commit
de300bf7a4
@ -22,8 +22,12 @@ ohos_shared_library("rebootmodule") {
|
||||
"..",
|
||||
"../init_hook",
|
||||
"//base/startup/init/interfaces/innerkits/include/param",
|
||||
"//base/startup/init/interfaces/innerkits/include",
|
||||
]
|
||||
deps = [
|
||||
"//base/startup/init/interfaces/innerkits/init_module_engine:libinit_module_engine",
|
||||
"//base/startup/init/services/utils:libinit_utils",
|
||||
]
|
||||
deps = [ "//base/startup/init/interfaces/innerkits/init_module_engine:libinit_module_engine" ]
|
||||
|
||||
external_deps = [ "bounds_checking_function:libsec_shared" ]
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "reboot_adp.h"
|
||||
#include "init_cmdexecutor.h"
|
||||
#include "init_module_engine.h"
|
||||
#include "init_utils.h"
|
||||
#include "plugin_adapter.h"
|
||||
#include "securec.h"
|
||||
|
||||
@ -72,6 +73,10 @@ static int DoRebootPanic(int id, const char *name, int argc, const char **argv)
|
||||
}
|
||||
}
|
||||
PLUGIN_LOGI("DoRebootPanic %s", str);
|
||||
if (InRescueMode() == 0) {
|
||||
PLUGIN_LOGI("Don't panic in resuce mode!");
|
||||
return 0;
|
||||
}
|
||||
// clear misc
|
||||
(void)UpdateMiscMessage(NULL, "reboot", NULL, NULL);
|
||||
DoJobNow("reboot");
|
||||
|
Loading…
x
Reference in New Issue
Block a user