aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-09-08 15:42:02 -0500
committerRob Landley <rob@landley.net>2018-09-08 15:42:50 -0500
commit288321ac86375450f5f57990201a56c385936323 (patch)
tree4becf32d768faee3e45f235aeef3d8955ef442ad /lib
parentef3044114acac33c8231ace80766ec6d9133150a (diff)
downloadtoybox-288321ac86375450f5f57990201a56c385936323.tar.gz
Tweaks to make building with Android NDK's llvm happier.
Diffstat (limited to 'lib')
-rw-r--r--lib/lsm.h2
-rw-r--r--lib/portability.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/lsm.h b/lib/lsm.h
index e21d424b..ada54c98 100644
--- a/lib/lsm.h
+++ b/lib/lsm.h
@@ -55,7 +55,7 @@ static inline char *lsm_name(void)
static inline char *lsm_context(void)
{
int ok = 0;
- char *result;
+ char *result = 0;
if (CFG_TOYBOX_SMACK) ok = smack_new_label_from_self(&result) > 0;
else ok = getcon(&result) == 0;
diff --git a/lib/portability.h b/lib/portability.h
index 39e61810..0404c85e 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -256,3 +256,11 @@ extern CODE prioritynames[], facilitynames[];
#include <sys/random.h>
#endif
void xgetrandom(void *buf, unsigned len, unsigned flags);
+
+// android NDK doesn't have confstr
+#ifndef _CS_PATH
+#define _CS_PATH 0
+#define _CS_V7_ENV 1
+#include <string.h>
+static inline void confstr(int a, char *b, int c) {strcpy(b, a ? "POSIXLY_CORRECT=1" : "/bin:/usr/bin");}
+#endif