File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ static void run_child(
143143 _exit (child_exit_code );
144144}
145145
146+ /* Do not use this variable unless you are doing debugging or fault injection
147+ * in a metatest of mbedtls_test_fork_run_child() */
148+ int mbedtls_test_fork_child_fd = -1 ;
149+
146150int mbedtls_test_fork_run_child (
147151 mbedtls_test_fork_child_callback_t * child_callback ,
148152 void * param ,
@@ -169,6 +173,7 @@ int mbedtls_test_fork_run_child(
169173 (long ) getpid (), (void * ) filename );
170174 file = fopen (filename , "w+" );
171175 TEST_ASSERT_ERRNO (file != NULL );
176+ mbedtls_test_fork_child_fd = fileno (file );
172177 unlink (filename );
173178
174179 /* The temporary file will contain the test result from the child,
@@ -226,6 +231,7 @@ int mbedtls_test_fork_run_child(
226231 * child_output_length = len ;
227232
228233 fclose (file );
234+ mbedtls_test_fork_child_fd = -1 ;
229235 return 0 ;
230236
231237exit :
You can’t perform that action at this time.
0 commit comments