Merge change I502d5a9b into eclair-mr2

* changes:
  construct event-log-tags via the new build mechanism
diff --git a/adb/commandline.c b/adb/commandline.c
index 055aa10..39ffdae 100644
--- a/adb/commandline.c
+++ b/adb/commandline.c
@@ -990,9 +990,13 @@
     if(!strcmp(argv[0], "forward")) {
         if(argc != 3) return usage();
         if (serial) {
-            snprintf(buf, sizeof buf, "host-serial:%s:forward:%s;%s",serial,argv[1],argv[2]);
+            snprintf(buf, sizeof buf, "host-serial:%s:forward:%s;%s",serial, argv[1], argv[2]);
+        } else if (ttype == kTransportUsb) {
+            snprintf(buf, sizeof buf, "host-usb:forward:%s;%s", argv[1], argv[2]);
+        } else if (ttype == kTransportLocal) {
+            snprintf(buf, sizeof buf, "host-local:forward:%s;%s", argv[1], argv[2]);
         } else {
-            snprintf(buf, sizeof buf, "host:forward:%s;%s",argv[1],argv[2]);
+            snprintf(buf, sizeof buf, "host:forward:%s;%s", argv[1], argv[2]);
         }
         if(adb_command(buf)) {
             fprintf(stderr,"error: %s\n", adb_error());
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 64d9bb7..8134aa1 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -53,13 +53,22 @@
     sprintf(path, "/dev/cpuctl/%s/tasks", grp_name);
 
     if ((fd = open(path, O_WRONLY)) < 0) {
-        LOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path, strerror(errno));
+        LOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path,
+             strerror(errno));
         return -1;
     }
 
     sprintf(text, "%d", tid);
     if (write(fd, text, strlen(text)) < 0) {
         close(fd);
+	/*
+	 * If the thread is in the process of exiting,
+	 * don't flag an error
+	 */
+	if (errno == ESRCH)
+		return 0;
+        LOGW("add_tid_to_cgroup failed to write '%s' (%s)\n", path,
+             strerror(errno));
         return -1;
     }