#include <Fork.h>
Inheritance diagram for ASSA::ChildStatusHandler:
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 |
Definition at line 58 of file Fork.h.
ASSA::ChildStatusHandler::ChildStatusHandler | ( | ) | [inline] |
bool ASSA::ChildStatusHandler::caught | ( | ) | const [inline] |
Definition at line 73 of file Fork.h.
References m_caught.
Referenced by ASSA::Fork::Fork().
00073 { 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().
00069 { 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.
00136 { 00137 trace_with_mask("ChildStatusHandler::handle_signal", FORK); 00138 DL((FORK, "Caught signal # %d\n", signum_)); 00139 00140 if (signum_ == SIGCHLD) { 00141 int status; 00142 m_caught = true; 00143 pid_t ret = ::wait (&status); 00144 DL((FORK,"wait() = %d (PID)\n", ret)); 00145 00146 if (ret > 0 && (WIFEXITED (status))) { 00147 m_exit_status = WEXITSTATUS (status); 00148 } 00149 else { 00150 m_exit_status = ret; 00151 } 00152 } 00153 00154 DL((FORK,"child exit_status = %d\n", m_exit_status)); 00155 return 0; 00156 }
bool ASSA::ChildStatusHandler::m_caught [private] |
int ASSA::ChildStatusHandler::m_exit_status [private] |