#include <security_utilities/debugging.h>
#include <signal.h>
+#include <sstream>
namespace Security {
namespace UnixPlusPlus {
secinfo("unixchild", "checking %p (pid %d)", this, this->pid());
int status;
again:
- switch (IFDEBUG(pid_t pid =) ::wait4(this->pid(), &status, options, NULL)) {
+ switch (pid_t pid = ::wait4(this->pid(), &status, options, NULL)) {
case pid_t(-1):
switch (errno) {
case EINTR:
default:
UnixError::throwMe();
}
- break; // placebo
case 0:
return false; // child not ready (do nothing)
default:
} else if (!mChildren().empty()) {
int status;
while (pid_t pid = ::wait4(0, &status, WNOHANG, NULL)) {
- secinfo("unixchild", "universal child check (%ld children known alive)", mChildren().size());
+ ostringstream os;
+ os << "universal child check (" << mChildren().size() << " children known alive)";
+ secinfo("unixchild", "%s", os.str().c_str());
switch (pid) {
case pid_t(-1):
switch (errno) {
default:
UnixError::throwMe();
}
- break;
default:
if (Child *child = mChildren()[pid]) {
child->bury(status);