libassa 3.5.0
|
A helper class of Fork. More...
#include <Fork.h>
Public Member Functions | |
ChildStatusHandler () | |
int | handle_signal (int signum_) |
Signal handler callback. | |
int | exit_status () const |
bool | caught () const |
Private Attributes | |
int | m_exit_status |
bool | m_caught |
ASSA::ChildStatusHandler::ChildStatusHandler | ( | ) | [inline] |
Definition at line 61 of file Fork.h.
: m_exit_status (-1), m_caught (false) { /* no-op */ }
bool ASSA::ChildStatusHandler::caught | ( | ) | const [inline] |
Definition at line 73 of file Fork.h.
References m_caught.
Referenced by ASSA::Fork::Fork().
{ return m_caught; }
int ASSA::ChildStatusHandler::exit_status | ( | ) | const [inline] |
Definition at line 69 of file Fork.h.
References m_exit_status.
Referenced by ASSA::Fork::get_exit_status().
{ return m_exit_status; }
int ChildStatusHandler::handle_signal | ( | int | signum_ | ) | [virtual] |
Signal handler callback.
Reimplemented from ASSA::EventHandler.
Definition at line 135 of file Fork.cpp.
References DL, ASSA::FORK, m_caught, m_exit_status, and trace_with_mask.
{ trace_with_mask("ChildStatusHandler::handle_signal", FORK); DL((FORK, "Caught signal # %d\n", signum_)); if (signum_ == SIGCHLD) { int status; m_caught = true; pid_t ret = ::wait (&status); DL((FORK,"wait() = %d (PID)\n", ret)); if (ret > 0 && (WIFEXITED (status))) { m_exit_status = WEXITSTATUS (status); } else { m_exit_status = ret; } } DL((FORK,"child exit_status = %d\n", m_exit_status)); return 0; }
bool ASSA::ChildStatusHandler::m_caught [private] |
Definition at line 77 of file Fork.h.
Referenced by caught(), and handle_signal().
int ASSA::ChildStatusHandler::m_exit_status [private] |
Definition at line 76 of file Fork.h.
Referenced by exit_status(), and handle_signal().