From ec6115835ec99a6502a5096a5a07177a5455848c Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 14 Jun 2024 17:25:13 +0200 Subject: [PATCH] Add perror to report the reason for a fork failure --- utest/test_fork.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utest/test_fork.c b/utest/test_fork.c index 558026031..3d4faa9b1 100644 --- a/utest/test_fork.c +++ b/utest/test_fork.c @@ -33,6 +33,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include "openblas_utest.h" @@ -103,6 +104,7 @@ exit(0); fork_pid = fork(); if (fork_pid == -1) { + perror(fork"); CTEST_ERR("Failed to fork process."); } else if (fork_pid == 0) { // Compute a DGEMM product in the child process to check that the @@ -113,7 +115,8 @@ exit(0); // recursively fork_pid_nested = fork(); if (fork_pid_nested == -1) { - CTEST_ERR("Failed to fork process."); + perror("fork"); + CTEST_ERR("Failed to fork nested process."); exit(1); } else if (fork_pid_nested == 0) { check_dgemm(a, b, d, c, n);