fake_state_process_t state_process = fake_state_process_t_initialize;
bool success = F_true;
+ bool success_block = F_true;
int result;
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
if (state_process.operation != fake_make_operation_type_else_e) {
state_process.block = 0;
state_process.block_result = 0;
+
+ // When the block ends and the block success is false, pass the failure to the success variable so that "failure" conditions can catch this.
+ if (success && !success_block) {
+ success = F_false;
+ }
+
+ success_block = F_true;
}
}
if (F_status_is_error(*status)) {
if (state_process.block || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_or_e) {
+ success_block = F_false;
// Setting error result informs the post-process that the operate process is not run due to an error during the pre-process.
if (state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_or_e || state_process.operation == fake_make_operation_type_else_e) {
return result;
}
- if (state_process.block && F_status_is_error(result)) {
+ if (state_process.block && F_status_is_error(*status)) {
state_process.block_result == fake_condition_result_error_e;
+ success_block = F_false;
}
}
if (state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_else_e) {
state_process.block = 0;
state_process.block_result = 0;
+
+ // When the block ends and the block success is false, pass the failure to the success variable so that "failure" conditions can catch this.
+ if (success && !success_block) {
+ success = F_false;
+ }
+
+ success_block = F_true;
}
else if (state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_or_e) {
if (state_process.block_result == fake_condition_result_error_e) {
state_process.block_result = fake_condition_result_false_e;
+ success_block = F_false;
}
}
else {
else if (state_process.block_result == fake_condition_result_false_e || state_process.block_result == fake_condition_result_error_e) {
state_process.block = fake_state_process_block_next_e;
state_process.block_result = fake_condition_result_false_e;
+
+ if (state_process.block_result == fake_condition_result_error_e) {
+ success_block = F_false;
+ }
}
else {
state_process.block = fake_state_process_block_skip_e;
else {
state_process.block = 0;
state_process.block_result = 0;
+
+ // When the block ends and the block success is false, pass the failure to the success variable so that "failure" conditions can catch this.
+ if (success && !success_block) {
+ success = F_false;
+ }
+
+ success_block = F_true;
}
}
}
if (state_process.block_result == fake_condition_result_error_e) {
state_process.block = fake_state_process_block_if_skip_e;
state_process.block_result = fake_condition_result_false_e;
+ success_block = F_false;
}
else {
state_process.block = fake_state_process_block_if_e;
break;
}
+ else if (*status == F_failure) {
+
+ // When F_failure (without the error bit) is returned, an error occured but the exit mode is not set to exit.
+ // Record the success state and set the status to F_none.
+ *status = F_none;
+ success = F_false;
+ }
else {
success = F_true;
}
- <=: Two or more Content.
- <>: Two or more Content.
- defined: First Content is either "parameter" or "environment". Second or more Content are valid names, such that for "parameter" it is a valid IKI name and for "environment" it is a valid environment variable name.
- - fail: has no other Content.
+ - failure: has no other Content.
- group: First Content is the name of a group. Second or more Content are paths to files.
- is: First Content is a list of "block", "character", "directory", "fifo", "link", "regular" , or "socket" followed by "for" and then the Remaining Content that are paths to files.
- mode: First Content is either "is" or "has". Second Content is a valid file mode. Third or more Content are paths to files.