1. There seems to be copy paste error, instead of clearing sigusr_action.sa_mask it clears sigint_action.sa_mask. Change comes from 6c4d1c6d4b3c116ff88f9209b4860940fb8659a8
2. Other fields of these structures are left to be uninitialized. Both 1) and 2) make the behaviour unexpected. Occasionally I saw, this program to end upon receiving SIGUSR1. Signed-off-by: Jan Stancek <[email protected]> --- .../controllers/memcg/functional/memcg_process.c | 9 ++- diff --git a/testcases/kernel/controllers/memcg/functional/memcg_process.c b/testcases/kernel/controllers/memcg/functional/memcg_process.c index bccb2da..da91dc9 100644 --- a/testcases/kernel/controllers/memcg/functional/memcg_process.c +++ b/testcases/kernel/controllers/memcg/functional/memcg_process.c @@ -295,17 +295,18 @@ int main(int argc, char *argv[]) if ((fd = open("/dev/zero", O_RDWR)) == -1) err(1, "open /dev/zero failed"); + memset(&sigint_action, 0, sizeof(sigint_action)); + memset(&sigusr_action, 0, sizeof(sigusr_action)); + /* TODO: writer error handling here. */ sigemptyset(&sigint_action.sa_mask); sigint_action.sa_handler = &sigint_handler; sigaction(SIGINT, &sigint_action, NULL); - sigemptyset(&sigint_action.sa_mask); + sigemptyset(&sigusr_action.sa_mask); sigusr_action.sa_handler = &sigusr_handler; sigaction(SIGUSR1, &sigusr_action, NULL); - sigemptyset(&sigusr_action.sa_mask); - process_options(argc, argv); while (!flag_exit) -- 1.7.1 ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
