minishell
Minishell Project for École 42
|
Functions for checking the exit code of a process. More...
#include "minishell.h"
Functions | |
void | check_exitcode (int wstatus, bool *is_print) |
Checks the exit code of a child process and update g_exit_code. | |
Functions for checking the exit code of a process.
Contains functions for checking the exit code of a child process and updating g_exit_code accordingly. Handles normal exit and signal termination.
void check_exitcode | ( | int | wstatus, |
bool * | is_print | ||
) |
Checks the exit code of a child process and update g_exit_code.
Checks the exit code of a child process and updates g_exit_code based on wether the process exited normally or was terminated by a signal. If the process exited normally, the exit status is used. If the process was terminated bt a signal, the signalnumber is added to the base (128) to set the exit code.
[in] | wstatus | The status of the child process. |
[in,out] | is_print | A pointer to a boolean indicating wether to print the SIGQUIT message. |