summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2017-12-05 10:20:12 -0800
committer Chih-Hung Hsieh <chh@google.com> 2017-12-05 10:23:10 -0800
commitf463e180e5a69b4a43acd41c41c8518fa8c22b2d (patch)
treedfc1d3046e4069cdb140e89f26f1bc638ab32ac8
parent1eaa10357344343b91d242a7ea774cc23beeab74 (diff)
Use -Werror in frameworks/native/cmds/cmd
* Ignore return value of getfilecon? Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: I341e6047dbb5b49a92f69df74b073d2f54a7754d
-rw-r--r--cmds/cmd/Android.mk2
-rw-r--r--cmds/cmd/cmd.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/cmds/cmd/Android.mk b/cmds/cmd/Android.mk
index d565e57f43..4868555b34 100644
--- a/cmds/cmd/Android.mk
+++ b/cmds/cmd/Android.mk
@@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \
libselinux \
libbinder
+LOCAL_CFLAGS := -Wall -Werror
+
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
diff --git a/cmds/cmd/cmd.cpp b/cmds/cmd/cmd.cpp
index 6511b446c1..48d5d4aed7 100644
--- a/cmds/cmd/cmd.cpp
+++ b/cmds/cmd/cmd.cpp
@@ -104,7 +104,7 @@ public:
if (is_selinux_enabled() && seLinuxContext.size() > 0) {
String8 seLinuxContext8(seLinuxContext);
security_context_t tmp = NULL;
- int ret = getfilecon(fullPath.string(), &tmp);
+ getfilecon(fullPath.string(), &tmp);
Unique_SecurityContext context(tmp);
if (checkWrite) {
int accessGranted = selinux_check_access(seLinuxContext8.string(), context.get(),