summaryrefslogtreecommitdiffstats
path: root/init/builtins.c
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-10-10 12:37:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-10 12:37:05 -0700
commit2f924ebe0b0891dba1996c246839427b23705018 (patch)
treef1b3d102bd4e7286bcf321438fbb7ea525467446 /init/builtins.c
parent4ff9c3f7d89fe418290288d0925f257f0fe15f20 (diff)
parenta94d2b392f830e3c0a1e4bd0d2d262314eada8d9 (diff)
downloadsystem_core-2f924ebe0b0891dba1996c246839427b23705018.zip
system_core-2f924ebe0b0891dba1996c246839427b23705018.tar.gz
system_core-2f924ebe0b0891dba1996c246839427b23705018.tar.bz2
am a94d2b39: Merge "Add a restorecon_recursive built-in command to init."
* commit 'a94d2b392f830e3c0a1e4bd0d2d262314eada8d9': Add a restorecon_recursive built-in command to init.
Diffstat (limited to 'init/builtins.c')
-rw-r--r--init/builtins.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/init/builtins.c b/init/builtins.c
index 576f0d9..33fc6c6 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -747,12 +747,24 @@ int do_chmod(int nargs, char **args) {
int do_restorecon(int nargs, char **args) {
int i;
+ int ret = 0;
for (i = 1; i < nargs; i++) {
if (restorecon(args[i]) < 0)
- return -errno;
+ ret = -errno;
}
- return 0;
+ return ret;
+}
+
+int do_restorecon_recursive(int nargs, char **args) {
+ int i;
+ int ret = 0;
+
+ for (i = 1; i < nargs; i++) {
+ if (restorecon_recursive(args[i]) < 0)
+ ret = -errno;
+ }
+ return ret;
}
int do_setsebool(int nargs, char **args) {