summaryrefslogtreecommitdiffstats
path: root/init/subcontext.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2018-02-13 16:50:08 -0800
committerTom Cherry <tomcherry@google.com>2018-02-28 10:45:45 -0800
commitde6bd50d4238d19ec401127bcf2321dc679d908d (patch)
treef181f4acfa59f642c5927fc706060b192a2638e6 /init/subcontext.cpp
parent304dacae8acd6c3469a7c5ff05357478ad2ff074 (diff)
downloadcore-de6bd50d4238d19ec401127bcf2321dc679d908d.tar.gz
core-de6bd50d4238d19ec401127bcf2321dc679d908d.tar.bz2
core-de6bd50d4238d19ec401127bcf2321dc679d908d.zip
init: add host side parser for init
Create a host side parser for init such that init rc files can be verified for syntax correctness before being used on the device. Bug: 36970783 Test: run the parser on init files on host Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
Diffstat (limited to 'init/subcontext.cpp')
-rw-r--r--init/subcontext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/init/subcontext.cpp b/init/subcontext.cpp
index f3b643ad7..faab36848 100644
--- a/init/subcontext.cpp
+++ b/init/subcontext.cpp
@@ -27,12 +27,14 @@
#include <selinux/android.h>
#include "action.h"
-#include "property_service.h"
-#include "selinux.h"
#include "util.h"
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
+#if defined(__ANDROID__)
+#include "property_service.h"
+#include "selinux.h"
+#else
+#include "host_init_stubs.h"
+#endif
using android::base::GetExecutablePath;
using android::base::Join;
@@ -83,7 +85,7 @@ std::vector<std::pair<std::string, std::string>> properties_to_set;
uint32_t SubcontextPropertySet(const std::string& name, const std::string& value) {
properties_to_set.emplace_back(name, value);
- return PROP_SUCCESS;
+ return 0;
}
class SubcontextProcess {