Squash commits for public release
This commit is contained in:
8
test/kernel/signal/signalself/BUILD.gn
Normal file
8
test/kernel/signal/signalself/BUILD.gn
Normal file
@@ -0,0 +1,8 @@
|
||||
import("//build/test/TEMPLATE.gni")
|
||||
|
||||
xOS_test("signalself") {
|
||||
test_bundle = "kernel/signal/signalself"
|
||||
sources = [ "main.c" ]
|
||||
configs = [ "//build/userland:userland_flags" ]
|
||||
deplibs = [ "libc" ]
|
||||
}
|
||||
18
test/kernel/signal/signalself/main.c
Normal file
18
test/kernel/signal/signalself/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int ret = 1;
|
||||
|
||||
void save_on_terminate()
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
sigaction(SIGTERM, save_on_terminate);
|
||||
raise(SIGTERM);
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user