* 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>
int ClatdController::stopClatd() {
if (mClatdPid == 0) {
- ALOGE("clatd already not running");
+ ALOGE("clatd already stopped");
return -1;
}
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
}