diff options
author | Elliott Hughes <enh@google.com> | 2015-04-07 22:32:49 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-04-07 22:32:49 -0700 |
commit | 5b50fc3d3ab4067cb73c3c9c3734a19a86cfca52 (patch) | |
tree | d62d7118c7910c2120d04fe89c229fcbcb393603 /toolbox | |
parent | bf403968878fca07c6df98852e8958ddda365bab (diff) | |
download | system_core-5b50fc3d3ab4067cb73c3c9c3734a19a86cfca52.zip system_core-5b50fc3d3ab4067cb73c3c9c3734a19a86cfca52.tar.gz system_core-5b50fc3d3ab4067cb73c3c9c3734a19a86cfca52.tar.bz2 |
Lose getprop to toybox.
Change-Id: I5188dbcc7e248b2fabade2d8d137610b4adb3164
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/Android.mk | 1 | ||||
-rw-r--r-- | toolbox/getprop.c | 50 |
2 files changed, 0 insertions, 51 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk index a866400..6f5567d 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -41,7 +41,6 @@ BSD_TOOLS := \ OUR_TOOLS := \ df \ getevent \ - getprop \ iftop \ ioctl \ ionice \ diff --git a/toolbox/getprop.c b/toolbox/getprop.c deleted file mode 100644 index dcc0ea0..0000000 --- a/toolbox/getprop.c +++ /dev/null @@ -1,50 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> - -#include <cutils/properties.h> - -#include "dynarray.h" - -static void record_prop(const char* key, const char* name, void* opaque) -{ - strlist_t* list = opaque; - char temp[PROP_VALUE_MAX + PROP_NAME_MAX + 16]; - snprintf(temp, sizeof temp, "[%s]: [%s]", key, name); - strlist_append_dup(list, temp); -} - -static void list_properties(void) -{ - strlist_t list[1] = { STRLIST_INITIALIZER }; - - /* Record properties in the string list */ - (void)property_list(record_prop, list); - - /* Sort everything */ - strlist_sort(list); - - /* print everything */ - STRLIST_FOREACH(list, str, printf("%s\n", str)); - - /* voila */ - strlist_done(list); -} - -int getprop_main(int argc, char *argv[]) -{ - if (argc == 1) { - list_properties(); - } else { - char value[PROPERTY_VALUE_MAX]; - char *default_value; - if(argc > 2) { - default_value = argv[2]; - } else { - default_value = ""; - } - - property_get(argv[1], value, default_value); - printf("%s\n", value); - } - return 0; -} |