OSDN Git Service

Merge "Host exemption now handles premarked sockets"
[android-x86/system-netd.git] / ClatdController.cpp
index 8201ab4..ba4ca27 100644 (file)
@@ -13,9 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <errno.h>
 #include <unistd.h>
-
+#include <errno.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 
@@ -70,7 +69,7 @@ int ClatdController::startClatd(char *interface) {
 
 int ClatdController::stopClatd() {
     if (mClatdPid == 0) {
-        ALOGE("clatd already not running");
+        ALOGE("clatd already stopped");
         return -1;
     }
 
@@ -85,15 +84,14 @@ int ClatdController::stopClatd() {
     return 0;
 }
 
-bool ClatdController::isClatdRunning() {
+bool ClatdController::isClatdStarted() {
     pid_t waitpid_status;
     if(mClatdPid == 0) {
         return false;
     }
     waitpid_status = waitpid(mClatdPid, NULL, WNOHANG);
     if(waitpid_status != 0) {
-        // child exited or stopped, don't call waitpid on it again
-        mClatdPid = 0;
+        mClatdPid = 0; // child exited, don't call waitpid on it again
     }
     return waitpid_status == 0; // 0 while child is running
 }