#include "PppController.h"
-extern "C" int logwrap(int argc, const char **argv, int background);
-
PppController::PppController() {
mTtys = new TtyCollection();
mPid = 0;
pid_t pid;
if (mPid) {
- LOGE("Multiple PPPD instances not currently supported");
+ ALOGE("Multiple PPPD instances not currently supported");
errno = EBUSY;
return -1;
}
}
}
if (it == mTtys->end()) {
- LOGE("Invalid tty '%s' specified", tty);
+ ALOGE("Invalid tty '%s' specified", tty);
errno = -EINVAL;
return -1;
}
if ((pid = fork()) < 0) {
- LOGE("fork failed (%s)", strerror(errno));
+ ALOGE("fork failed (%s)", strerror(errno));
return -1;
}
// but not getting a connection
if (execl("/system/bin/pppd", "/system/bin/pppd", "-detach", dev, "115200",
lr, "ms-dns", d1, "ms-dns", d2, "lcp-max-configure", "99999", (char *) NULL)) {
- LOGE("execl failed (%s)", strerror(errno));
+ ALOGE("execl failed (%s)", strerror(errno));
}
- LOGE("Should never get here!");
+ ALOGE("Should never get here!");
return 0;
} else {
mPid = pid;
int PppController::detachPppd(const char *tty) {
if (mPid == 0) {
- LOGE("PPPD already stopped");
+ ALOGE("PPPD already stopped");
return 0;
}
- LOGD("Stopping PPPD services on port %s", tty);
+ ALOGD("Stopping PPPD services on port %s", tty);
kill(mPid, SIGTERM);
waitpid(mPid, NULL, 0);
mPid = 0;
- LOGD("PPPD services on port %s stopped", tty);
+ ALOGD("PPPD services on port %s stopped", tty);
return 0;
}
DIR *d = opendir("/sys/class/tty");
if (!d) {
- LOGE("Error opening /sys/class/tty (%s)", strerror(errno));
+ ALOGE("Error opening /sys/class/tty (%s)", strerror(errno));
return -1;
}