summaryrefslogtreecommitdiffstats
path: root/adb/services.c
diff options
context:
space:
mode:
Diffstat (limited to 'adb/services.c')
-rw-r--r--adb/services.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/adb/services.c b/adb/services.c
index 6940be8..54d21a8 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -125,12 +125,10 @@ void restart_root_service(int fd, void *cookie)
return;
}
+ property_set("service.adb.root", "1");
snprintf(buf, sizeof(buf), "restarting adbd as root\n");
writex(fd, buf, strlen(buf));
adb_close(fd);
-
- // This will cause a property trigger in init.rc to restart us
- property_set("service.adb.root", "1");
}
}
@@ -152,10 +150,6 @@ void restart_tcp_service(int fd, void *cookie)
snprintf(buf, sizeof(buf), "restarting in TCP mode port: %d\n", port);
writex(fd, buf, strlen(buf));
adb_close(fd);
-
- // quit, and init will restart us in TCP mode
- sleep(1);
- exit(1);
}
void restart_usb_service(int fd, void *cookie)
@@ -166,10 +160,6 @@ void restart_usb_service(int fd, void *cookie)
snprintf(buf, sizeof(buf), "restarting in USB mode\n");
writex(fd, buf, strlen(buf));
adb_close(fd);
-
- // quit, and init will restart us in USB mode
- sleep(1);
- exit(1);
}
void reboot_service(int fd, void *arg)
@@ -212,7 +202,7 @@ static void echo_service(int fd, void *cookie)
int c;
for(;;) {
- r = read(fd, buf, 4096);
+ r = adb_read(fd, buf, 4096);
if(r == 0) goto done;
if(r < 0) {
if(errno == EINTR) continue;
@@ -369,7 +359,6 @@ static void subproc_waiter_service(int fd, void *cookie)
break;
}
}
- usleep(100000); // poll every 0.1 sec
}
D("shell exited fd=%d of pid=%d err=%d\n", fd, pid, errno);
if (SHELL_EXIT_NOTIFY_FD >=0) {