test: Add testcase for #1111

Refs: #1111
Change-Id: Ifdf25a9ce98ef495200daf1c24d7ac2c81b3ef17
This commit is contained in:
Ken Sato
2018-06-27 23:12:43 +09:00
committed by Masamichi Takagi
parent 04e54ead5d
commit c6cc0bf07a
10 changed files with 437 additions and 0 deletions

44
test/issues/1111/CT_004.c Normal file
View File

@@ -0,0 +1,44 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include "./test_chk.h"
#define TEST_NAME "CT_004"
int main(int argc, char **argv)
{
int rc = 0;
int status;
int tmp_flag = 0;
struct sigaction old_act;
printf("*** %s start *******************************\n", TEST_NAME);
rc = sigaction(SIGKILL, NULL, &old_act);
OKNG(rc != 0, "sigaction to get SIGKILL action");
if (old_act.sa_handler == SIG_DFL) {
tmp_flag = 1;
}
OKNG(tmp_flag != 1, "check SIGKILL act");
rc = sigaction(SIGSTOP, NULL, &old_act);
OKNG(rc != 0, "sigaction to get SIGSTOP action");
tmp_flag = 0;
if (old_act.sa_handler == SIG_DFL) {
tmp_flag = 1;
}
OKNG(tmp_flag != 1, "check SIGSTOP act");
printf("*** %s PASSED\n\n", TEST_NAME);
return 0;
fn_fail:
printf("*** %s FAILED\n\n", TEST_NAME);
return -1;
}