Previous: , Up: conditions child   [Contents][Index]


8.9.3 Child failure exit status

We can use the child failure exit status exceptional–condition object–type to signal the termination of a child process with a non–zero status; this happens when the process is terminated by a call to the exit() function with a non–zero argument or by simply returning non–zero from the main() function. We can instantiate this type and also derive new types from it. To catch this exceptional condition we can do:

cce_location_t        L[1];

if (cce_location(L)) {
  if (cctests_condition_is_child_failure_exit_status(cce_condition(L))) {
    CCTESTS_PC(cctests_condition_child_failure_exit_status_t, C, cce_condition(L));
    do_something_with(C);
  }
  cce_run_catch_handlers_final(L);
} else {
  do_something(L);
  cce_run_body_handlers(L);
}
Struct Typedef: cctests_descriptor_child_failure_exit_status_t

Type of data structure representing the exceptional–condition descriptor. It has the following public fields:

cce_descriptor_t descriptor

The condition descriptor’s base values.

The parent of this type descriptor is the one referenced by cctests_descriptor_child_failure_ptr, Child failure.

Struct Typedef: cctests_condition_child_failure_exit_status_t

Type of data structure representing the exceptional–condition object. It has the following public fields:

cctests_condition_child_failure_t child_failure

The condition object’s base values.

Function: void cce_descriptor_set_parent_to(cctests_condition_child_failure_exit_status_t) (cce_descriptor_t * const D)

Set the parent of the descriptor referenced by D to the descriptor of the exceptional–condition object–type cctests_condition_child_failure_exit_status_t.

Function: void cctests_condition_init_child_failure_exit_status (cctests_condition_child_failure_exit_status_t * C)

Initialisation function for the condition object. This function is meant to be called from the initialisation function of sub–types of cctests_condition_child_failure_exit_status_t.

Function: cce_condition_t const * cctests_condition_new_child_failure_exit_status (void)

Return a pointer to exceptional–condition object of type cctests_condition_child_failure_exit_status_t made opaque in the type cce_condition_t.

Function: bool cctests_condition_is_child_failure_exit_status (cce_condition_t const * C)

Return true if C if of type cctests_condition_child_failure_exit_status_t; otherwise return false.


Previous: , Up: conditions child   [Contents][Index]

This document describes version 0.4.1-devel.1 of CCTests.