aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-04-20 20:59:00 -0500
committerRob Landley <rob@landley.net>2015-04-20 20:59:00 -0500
commite5fb6a28ffb09782e4df08251956f42c48445147 (patch)
tree08b9f53707a21a96fa6bcf94f1098433eee87863
parent5b493dc48db03c7e27c8ce002fe216bcd778fe92 (diff)
downloadtoybox-e5fb6a28ffb09782e4df08251956f42c48445147.tar.gz
Switch setprop to use TOYBOX_ON_ANDROID and fix getprop include.
(I commented out the android-only #include in getprop to do what compile testing I could, and then forgot to uncomment it.)
-rw-r--r--toys/android/getprop.c2
-rw-r--r--toys/android/setprop.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/toys/android/getprop.c b/toys/android/getprop.c
index 9d5398aa..400d80e7 100644
--- a/toys/android/getprop.c
+++ b/toys/android/getprop.c
@@ -17,7 +17,7 @@ config GETPROP
#define FOR_getprop
#include "toys.h"
-//#include <cutils/properties.h>
+#include <cutils/properties.h>
GLOBALS(
size_t size;
diff --git a/toys/android/setprop.c b/toys/android/setprop.c
index ef24c9ad..cbcd152b 100644
--- a/toys/android/setprop.c
+++ b/toys/android/setprop.c
@@ -7,6 +7,7 @@ USE_SETPROP(NEWTOY(setprop, "<2>2", TOYFLAG_USR|TOYFLAG_SBIN))
config SETPROP
bool "setprop"
default y
+ depends on TOYBOX_ON_ANDROID
help
usage: setprop NAME VALUE
@@ -16,13 +17,10 @@ config SETPROP
#define FOR_setprop
#include "toys.h"
-#if defined(__ANDROID__)
#include <cutils/properties.h>
-#endif
void setprop_main(void)
{
-#if defined(__ANDROID__)
char *name = toys.optargs[0], *value = toys.optargs[1];
char *p;
size_t name_len = strlen(name), value_len = strlen(value);
@@ -48,5 +46,4 @@ void setprop_main(void)
if (property_set(name, value))
error_msg("failed to set property '%s' to '%s'", name, value);
-#endif
}