summaryrefslogtreecommitdiff
path: root/cmds/app_process/app_main.cpp
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2016-09-13 16:19:33 +0100
committerNarayan Kamath <narayan@google.com>2016-09-14 10:24:20 +0100
commit5638991c8233139ecf6207b99851116e2d2c2714 (patch)
tree6ca4d11aaa9e020a050ec663ebd0cd4a0359e9a4 /cmds/app_process/app_main.cpp
parent3bc37e9cf7fb8349247d2b28673c8ada23538391 (diff)
app_main: failure to PR_SET_NO_NEW_PRIVS is always fatal.
Don't make allowances for older kernels. Kernels must handle this properly since it is now a CTS requirement. Also remove some unreachable return statements. Change-Id: I280c4ed5e461d37672236747b5dbb7d1e97ecfec
Diffstat (limited to 'cmds/app_process/app_main.cpp')
-rw-r--r--cmds/app_process/app_main.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 80af5ea9fdaf..18ad43eac37e 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -185,12 +185,7 @@ static const char ZYGOTE_NICE_NAME[] = "zygote";
int main(int argc, char* const argv[])
{
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) {
- // Older kernels don't understand PR_SET_NO_NEW_PRIVS and return
- // EINVAL. Don't die on such kernels.
- if (errno != EINVAL) {
- LOG_ALWAYS_FATAL("PR_SET_NO_NEW_PRIVS failed: %s", strerror(errno));
- return 12;
- }
+ LOG_ALWAYS_FATAL("PR_SET_NO_NEW_PRIVS failed: %s", strerror(errno));
}
AppRuntime runtime(argv[0], computeArgBlockSize(argc, argv));
@@ -309,6 +304,5 @@ int main(int argc, char* const argv[])
fprintf(stderr, "Error: no class name or --zygote supplied.\n");
app_usage();
LOG_ALWAYS_FATAL("app_process: no class name or --zygote supplied.");
- return 10;
}
}