Clean up su.

Stop building su as a static executable. We don't rely on the getuid
implementation for security, so we have nothing to fear from the dynamic
linker.

Add some missing error checking and improve error reporting.

Remove various special cases that can all be rolled into the general
case.

Bug: 19647373
Change-Id: I2689b8957a89da1f3be571fcdc966b1084efca9a
diff --git a/su/Android.mk b/su/Android.mk
index 0593cc9..297e0a3 100644
--- a/su/Android.mk
+++ b/su/Android.mk
@@ -1,14 +1,12 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
+LOCAL_CFLAGS := -std=c11 -Wall -Werror
+
 LOCAL_SRC_FILES:= su.c
 
 LOCAL_MODULE:= su
 
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-
-LOCAL_STATIC_LIBRARIES := libc
-
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug