Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
network:ha-clustering:Unstable
ocfs2-test
0001-inline-data-fix-that-child-process-exits-a...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-inline-data-fix-that-child-process-exits-abnormally.patch of Package ocfs2-test
From 626b82ddfc0c4659bdd74ccc9ace5f811210d6d2 Mon Sep 17 00:00:00 2001 From: Gang He <ghe@suse.com> Date: Fri, 22 Oct 2021 12:17:10 +0800 Subject: [PATCH] inline-data: fix that child process exits abnormally Sometimes, we encounter inline-data test case fails since child process exits abnormally. But, in fact, the child process run the test code with successful exit. The root cause is there is a programming error, we should wait the child process to exist twice. --- programs/inline-data/inline-data.c | 16 ---------------- programs/inline-data/inline-dirs.c | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/programs/inline-data/inline-data.c b/programs/inline-data/inline-data.c index daaee3c..c04514e 100644 --- a/programs/inline-data/inline-data.c +++ b/programs/inline-data/inline-data.c @@ -253,18 +253,6 @@ static int teardown(void) return 0; } -static void sigchld_handler() -{ - pid_t pid; - int status; - - while (1) { - pid = wait3(&status, WNOHANG, NULL); - if (pid <= 0) - break; - } -} - static void kill_all_children() { int i; @@ -316,8 +304,6 @@ static int concurrent_rw_test(void) if (fd < 0) return -1; - signal(SIGCHLD, sigchld_handler); - for (i = 0; i < child_nums; i++) { pid = fork(); if (pid < 0) { @@ -395,8 +381,6 @@ static int multi_file_rw_test(int test_num) fflush(stderr); fflush(stdout); - signal(SIGCHLD, sigchld_handler); - for (j = 0; j < file_nums; j++) { pid = fork(); if (pid < 0) { diff --git a/programs/inline-data/inline-dirs.c b/programs/inline-data/inline-dirs.c index 0db24b9..140638d 100644 --- a/programs/inline-data/inline-dirs.c +++ b/programs/inline-data/inline-dirs.c @@ -354,18 +354,6 @@ static void run_large_dir_tests(void) testno++; } -static void sigchld_handler() -{ - pid_t pid; - int status; - - while (1) { - pid = wait3(&status, WNOHANG, NULL); - if (pid <= 0) - break; - } -} - static void kill_all_children() { int i; @@ -503,8 +491,6 @@ static void run_concurrent_test(void) fflush(stderr); fflush(stdout); - signal(SIGCHLD, sigchld_handler); - for (i = 0; i < child_nums; i++) { pid = fork(); if (pid < 0) { @@ -573,8 +559,6 @@ static void run_multiple_test(void) fflush(stderr); fflush(stdout); - signal(SIGCHLD, sigchld_handler); - for (i = 0; i < file_nums; i++) { pid = fork(); if (pid < 0) { -- 2.12.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor