summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2016-06-24 17:02:03 -0500
committerElliott Hughes2016-06-24 17:02:03 -0500
commit50f39ddb4980d51a5ef106d96fc04038b47506be (patch)
tree18f68624362e40c01ddcc979e9d113595180517e /toolbox
parentaa9f37185fa9a1dc0ff90a5cf9c35a7d54f3da4b (diff)
downloadplatform-system-core-50f39ddb4980d51a5ef106d96fc04038b47506be.tar.gz
platform-system-core-50f39ddb4980d51a5ef106d96fc04038b47506be.tar.xz
platform-system-core-50f39ddb4980d51a5ef106d96fc04038b47506be.zip
Lose start/stop to toybox.
Change-Id: Ifd918a40616ec55fd3e782423fba67e0183bb8f3
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk3
-rw-r--r--toolbox/start.c1
-rw-r--r--toolbox/start_stop.cpp43
-rw-r--r--toolbox/stop.c1
4 files changed, 0 insertions, 48 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index 23af1f9bc..c7b6d4c0b 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -34,13 +34,10 @@ OUR_TOOLS := \
34 getevent \ 34 getevent \
35 newfs_msdos \ 35 newfs_msdos \
36 sendevent \ 36 sendevent \
37 start \
38 stop \
39 37
40ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) 38ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
41 39
42LOCAL_SRC_FILES := \ 40LOCAL_SRC_FILES := \
43 start_stop.cpp \
44 toolbox.c \ 41 toolbox.c \
45 $(patsubst %,%.c,$(OUR_TOOLS)) \ 42 $(patsubst %,%.c,$(OUR_TOOLS)) \
46 43
diff --git a/toolbox/start.c b/toolbox/start.c
deleted file mode 100644
index cca5fef61..000000000
--- a/toolbox/start.c
+++ /dev/null
@@ -1 +0,0 @@
1/* Needed by Android.mk. Actual code in start_stop.cpp. */
diff --git a/toolbox/start_stop.cpp b/toolbox/start_stop.cpp
deleted file mode 100644
index dc48c0c0c..000000000
--- a/toolbox/start_stop.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
1#include <error.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5#include <unistd.h>
6
7#include <cutils/properties.h>
8
9static const char* services[] = {
10 "netd",
11 "surfaceflinger",
12 "zygote",
13 "zygote_secondary",
14};
15
16static int start_stop(bool start, int argc, char* argv[]) {
17 if (getuid() != 0) error(1, 0, "must be root");
18 const char* property = start ? "ctl.start" : "ctl.stop";
19 if (argc > 2) {
20 error(1, 0, "usage: %s [SERVICE]\n", argv[0]);
21 } else if (argc == 2) {
22 property_set(property, argv[1]);
23 } else {
24 if (start) {
25 for (size_t i = 0; i < sizeof(services)/sizeof(services[0]); ++i) {
26 property_set(property, services[i]);
27 }
28 } else {
29 for (int i = sizeof(services)/sizeof(services[0]) - 1; i >= 0; --i) {
30 property_set(property, services[i]);
31 }
32 }
33 }
34 return 0;
35}
36
37extern "C" int start_main(int argc, char* argv[]) {
38 return start_stop(true, argc, argv);
39}
40
41extern "C" int stop_main(int argc, char* argv[]) {
42 return start_stop(false, argc, argv);
43}
diff --git a/toolbox/stop.c b/toolbox/stop.c
deleted file mode 100644
index cca5fef61..000000000
--- a/toolbox/stop.c
+++ /dev/null
@@ -1 +0,0 @@
1/* Needed by Android.mk. Actual code in start_stop.cpp. */