OSDN Git Service

HACK: Need to startup dhcpd for non-system bluetooth stack
authorMatthew Xie <mattx@google.com>
Thu, 12 Jul 2012 23:42:07 +0000 (16:42 -0700)
committerMatthew Xie <mattx@google.com>
Sat, 14 Jul 2012 09:17:41 +0000 (02:17 -0700)
Add TODO comments to remove start/stopReverseTethering
Return error code with exit() in child process in startReverseTethering
when executing dhcpcd fails.
This is needed so we can get BT certification.
The cleanup is tracked in stopship b/6820232

Change-Id: I98a1c8aedfa042b1824de7d8c69f2600c9bfcf29

TetherController.cpp

index ceac0b9..2c48074 100644 (file)
@@ -187,6 +187,8 @@ int TetherController::stopTethering() {
     ALOGD("Tethering services stopped");
     return 0;
 }
+
+// TODO(BT) remove
 int TetherController::startReverseTethering(const char* iface) {
     if (mDhcpcdPid != 0) {
         ALOGE("Reverse tethering already started");
@@ -228,13 +230,18 @@ int TetherController::startReverseTethering(const char* iface) {
             ALOGE("startReverseTethering, execv failed (%s)", strerror(errno));
         }
         ALOGE("startReverseTethering, Should never get here!");
-        return 0;
+        // TODO(BT) inform parent of the failure.
+        //          Parent process need wait for child to report error status
+        //          before it set mDhcpcdPid and return 0.
+        exit(-1);
     } else {
         mDhcpcdPid = pid;
         ALOGD("Reverse Tethering running, pid:%d", pid);
     }
     return 0;
 }
+
+// TODO(BT) remove
 int TetherController::stopReverseTethering() {
 
     if (mDhcpcdPid == 0) {