]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_utilities/lib/unixchild.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / unixchild.cpp
index edddcc0ea48d0384ec20d00cd2ab1963a9e6dd26..b6369d5cc633a437582f9597f41a0bec57bb32ac 100644 (file)
@@ -42,6 +42,7 @@
 #include <security_utilities/debugging.h>
 #include <signal.h>
 
+#include <sstream>
 
 namespace Security {
 namespace UnixPlusPlus {
@@ -371,7 +372,7 @@ bool Child::checkStatus(int options)
        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:
@@ -384,7 +385,6 @@ bool Child::checkStatus(int options)
                default:
                        UnixError::throwMe();
                }
-               break;  // placebo
        case 0:
                return false;   // child not ready (do nothing)
        default:
@@ -421,7 +421,9 @@ void Child::checkChildren()
                } 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) {
@@ -437,7 +439,6 @@ void Child::checkChildren()
                                        default:
                                                UnixError::throwMe();
                                        }
-                                       break;
                                default:
                                        if (Child *child = mChildren()[pid]) {
                                                child->bury(status);