From 50f39ddb4980d51a5ef106d96fc04038b47506be Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 24 Jun 2016 15:02:03 -0700 Subject: [PATCH] Lose start/stop to toybox. Change-Id: Ifd918a40616ec55fd3e782423fba67e0183bb8f3 --- toolbox/Android.mk | 3 --- toolbox/start.c | 1 - toolbox/start_stop.cpp | 43 ------------------------------------------ toolbox/stop.c | 1 - 4 files changed, 48 deletions(-) delete mode 100644 toolbox/start.c delete mode 100644 toolbox/start_stop.cpp delete mode 100644 toolbox/stop.c 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 := \ getevent \ newfs_msdos \ sendevent \ - start \ - stop \ ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) LOCAL_SRC_FILES := \ - start_stop.cpp \ toolbox.c \ $(patsubst %,%.c,$(OUR_TOOLS)) \ 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 @@ -/* 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 @@ -#include -#include -#include -#include -#include - -#include - -static const char* services[] = { - "netd", - "surfaceflinger", - "zygote", - "zygote_secondary", -}; - -static int start_stop(bool start, int argc, char* argv[]) { - if (getuid() != 0) error(1, 0, "must be root"); - const char* property = start ? "ctl.start" : "ctl.stop"; - if (argc > 2) { - error(1, 0, "usage: %s [SERVICE]\n", argv[0]); - } else if (argc == 2) { - property_set(property, argv[1]); - } else { - if (start) { - for (size_t i = 0; i < sizeof(services)/sizeof(services[0]); ++i) { - property_set(property, services[i]); - } - } else { - for (int i = sizeof(services)/sizeof(services[0]) - 1; i >= 0; --i) { - property_set(property, services[i]); - } - } - } - return 0; -} - -extern "C" int start_main(int argc, char* argv[]) { - return start_stop(true, argc, argv); -} - -extern "C" int stop_main(int argc, char* argv[]) { - return start_stop(false, argc, argv); -} 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 @@ -/* Needed by Android.mk. Actual code in start_stop.cpp. */