• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


コミットメタ情報

リビジョン961a88ab78ace6b5d76ef7ac1c22f92d3ab2f64d (tree)
日時2019-12-17 14:24:56
作者Chih-Wei Huang <cwhuang@linu...>
コミッターChih-Wei Huang

ログメッセージ

init: handle ctrl-alt-del event

By setting /proc/sys/kernel/ctrl-alt-del to 1, kernel will trap
ctrl-alt-del event and send a SIGINT signal to init.

Start the ctrl-alt-del service on receiving the signal.

変更サマリ

差分

--- a/init/reboot_utils.cpp
+++ b/init/reboot_utils.cpp
@@ -29,6 +29,7 @@
2929 #include <cutils/android_reboot.h>
3030
3131 #include "capabilities.h"
32+#include "init.h"
3233
3334 namespace android {
3435 namespace init {
@@ -167,6 +168,12 @@ void InstallRebootSignalHandlers() {
167168 #endif
168169 sigaction(SIGSYS, &action, nullptr);
169170 sigaction(SIGTRAP, &action, nullptr);
171+
172+ action.sa_handler = [](int sig) {
173+ LOG(INFO) << "Got ctrl-alt-del: " << sig;
174+ HandleControlMessage("start", "ctrl-alt-del", getpid());
175+ };
176+ sigaction(SIGINT, &action, nullptr);
170177 }
171178
172179 } // namespace init