OSDN Git Service

remove noisy logging and cruft code
authorKoushik Dutta <koushd@gmail.com>
Mon, 25 Feb 2013 21:47:13 +0000 (13:47 -0800)
committerKoushik Dutta <koushd@gmail.com>
Mon, 25 Feb 2013 21:47:13 +0000 (13:47 -0800)
Superuser/jni/su/activity.c
Superuser/jni/su/db.c
Superuser/jni/su/su.c

index 86b5bde..c48bf01 100644 (file)
 
 #include "su.h"
 
-static void kill_child(pid_t pid) {
-    LOGD("killing child %d", pid);
-    if (pid) {
-        sigset_t set, old;
-
-        sigemptyset(&set);
-        sigaddset(&set, SIGCHLD);
-        if (sigprocmask(SIG_BLOCK, &set, &old)) {
-            PLOGE("sigprocmask(SIG_BLOCK)");
-            return;
-        }
-        if (kill(pid, SIGKILL))
-            PLOGE("kill (%d)", pid);
-        else if (sigsuspend(&old) && errno != EINTR)
-            PLOGE("sigsuspend");
-        if (sigprocmask(SIG_SETMASK, &old, NULL))
-            PLOGE("sigprocmask(SIG_BLOCK)");
-    }
-}
-
 // TODO: leverage this with exec_log?
 static int silent_run(char* command) {
     char *args[] = { "sh", "-c", command, NULL, };
@@ -104,7 +84,6 @@ int send_result(struct su_context *ctx, policy_t policy) {
             ctx->from.name, ctx->to.name,
             ctx->from.uid, ctx->to.uid, get_command(&ctx->to), policy == ALLOW ? "allow" : "deny", ctx->user.android_user_id);
         silent_run(user_result_command);
-        LOGD(user_result_command);
     }
 
     char result_command[ARG_MAX];
index 5b788b6..0922d06 100644 (file)
@@ -55,7 +55,6 @@ static int database_callback(void *v, int argc, char **argv, char **azColName){
         else if (strcmp(azColName[i], "until") == 0) {
             if (argv[i] != NULL) {
                 until = atoi(argv[i]);
-                LOGD("Until: %d", until);
             }
         }
     }
index b443361..d7b3a0d 100644 (file)
@@ -178,7 +178,6 @@ static int get_multiuser_mode() {
         if (mode[last] == '\n')
             mode[last] = '\0';
         fgets(mode, sizeof(mode), fp);
-        LOGD("multiuser mode: %s", mode);
         if (strcmp(mode, MULTIUSER_VALUE_USER) == 0) {
             ret = MULTIUSER_MODE_USER;
         } else if (strcmp(mode, MULTIUSER_VALUE_OWNER_MANAGED) == 0) {
@@ -324,7 +323,6 @@ static int socket_accept(int serv_fd) {
     tv.tv_usec = 0;
     FD_ZERO(&fds);
     FD_SET(serv_fd, &fds);
-    LOGD("select");
     do {
         rc = select(serv_fd + 1, &fds, NULL, NULL, &tv);
     } while (rc < 0 && errno == EINTR);
@@ -738,7 +736,6 @@ int main(int argc, char *argv[]) {
     }
 
     int ret = mkdir(REQUESTOR_CACHE_PATH, 0770);
-    LOGD("mkdir: %d", ret);
     if (chown(REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid)) {
         PLOGE("chown (%s, %ld, %ld)", REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid);
         deny(&ctx);