aboutsummaryrefslogtreecommitdiff
path: root/initd/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'initd/main.c')
-rw-r--r--initd/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/initd/main.c b/initd/main.c
index 9cccdc5..e024c4e 100644
--- a/initd/main.c
+++ b/initd/main.c
@@ -96,6 +96,29 @@ void target_completed(int target)
}
}
+static int sigsetup(void)
+{
+ sigset_t mask;
+ int sfd;
+
+ sigfillset(&mask);
+ if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1) {
+ perror("sigprocmask");
+ return -1;
+ }
+
+ sfd = signalfd(-1, &mask, SFD_CLOEXEC);
+ if (sfd == -1) {
+ perror("signalfd");
+ return -1;
+ }
+
+ if (reboot(LINUX_REBOOT_CMD_CAD_OFF))
+ perror("cannot disable CTRL+ALT+DEL");
+
+ return sfd;
+}
+
int main(void)
{
int i, ret, count;