#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 55 of file Fork.h.
|
Definition at line 58 of file Fork.h. 00059 : m_exit_status (-1), m_caught (false) { /* no-op */ }
|
|
Definition at line 70 of file Fork.h. References m_caught. Referenced by ASSA::Fork::Fork(). 00070 { return m_caught; }
|
|
Definition at line 66 of file Fork.h. References m_exit_status. Referenced by ASSA::Fork::get_exit_status(). 00066 { return m_exit_status; }
|
|
Signal handler callback.
Reimplemented from ASSA::EventHandler. Definition at line 36 of file Fork.cpp. References DL, ASSA::FORK, m_caught, m_exit_status, and trace_with_mask. 00037 { 00038 trace_with_mask("ChildStatusHandler::handle_signal", FORK); 00039 DL((FORK, "Caught signal # %d\n", signum_)); 00040 00041 if (signum_ == SIGCHLD) { 00042 int status; 00043 m_caught = true; 00044 pid_t ret = ::wait (&status); 00045 DL((FORK,"wait() = %d (PID)\n", ret)); 00046 00047 if (ret > 0 && (WIFEXITED (status))) { 00048 m_exit_status = WEXITSTATUS (status); 00049 } 00050 else { 00051 m_exit_status = ret; 00052 } 00053 } 00054 DL((FORK,"child exit_status = %d\n", m_exit_status)); 00055 return 0; 00056 }
|
|
Definition at line 74 of file Fork.h. Referenced by caught(), and handle_signal(). |
|
Definition at line 73 of file Fork.h. Referenced by exit_status(), and handle_signal(). |