exit instead of returning when execv()ing clatd fails.

Returning instead of exiting when execv() fails causes mayhem, as
it results in two netd processes running, and netd commands being
processed by one of the two at random.

Bug: 18893886
Change-Id: I25afbabaef5955c9af7053b0333969b4e83549f1
diff --git a/server/ClatdController.cpp b/server/ClatdController.cpp
index b97ea32..348a0dd 100644
--- a/server/ClatdController.cpp
+++ b/server/ClatdController.cpp
@@ -57,6 +57,26 @@
         return -1;
     }
 
+    // Pass in the interface, a netid to use for DNS lookups, and a fwmark for outgoing packets.
+    unsigned netId = mNetCtrl->getNetworkForInterface(interface);
+    if (netId == NETID_UNSET) {
+        ALOGE("interface %s not assigned to any netId", interface);
+        errno = ENODEV;
+        return -1;
+    }
+
+    char netIdString[UINT32_STRLEN];
+    snprintf(netIdString, sizeof(netIdString), "%u", netId);
+
+    Fwmark fwmark;
+    fwmark.netId = netId;
+    fwmark.explicitlySelected = true;
+    fwmark.protectedFromVpn = true;
+    fwmark.permission = PERMISSION_SYSTEM;
+
+    char fwmarkString[UINT32_HEX_STRLEN];
+    snprintf(fwmarkString, sizeof(fwmarkString), "0x%x", fwmark.intValue);
+
     ALOGD("starting clatd on %s", interface);
 
     std::string progname("clatd-");
@@ -68,26 +88,6 @@
     }
 
     if (!pid) {
-        // Pass in the interface, a netid to use for DNS lookups, and a fwmark for outgoing packets.
-        unsigned netId = mNetCtrl->getNetworkForInterface(interface);
-        if (netId == NETID_UNSET) {
-            ALOGE("interface %s not assigned to any netId", interface);
-            errno = ENODEV;
-            return -1;
-        }
-
-        char netIdString[UINT32_STRLEN];
-        snprintf(netIdString, sizeof(netIdString), "%u", netId);
-
-        Fwmark fwmark;
-        fwmark.netId = netId;
-        fwmark.explicitlySelected = true;
-        fwmark.protectedFromVpn = true;
-        fwmark.permission = PERMISSION_SYSTEM;
-
-        char fwmarkString[UINT32_HEX_STRLEN];
-        snprintf(fwmarkString, sizeof(fwmarkString), "0x%x", fwmark.intValue);
-
         char *args[] = {
             (char *) progname.c_str(),
             (char *) "-i",
@@ -101,10 +101,10 @@
 
         if (execv(kClatdPath, args)) {
             ALOGE("execv failed (%s)", strerror(errno));
-            return -1;
+            _exit(1);
         }
         ALOGE("Should never get here!");
-        _exit(0);
+        _exit(1);
     } else {
         mClatdPids[interface] = pid;
         ALOGD("clatd started on %s", interface);