Loading vold/format.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ int format_partition(blkdev_t *part, char *type) args[3] = "-O android"; args[3] = "-O android"; args[4] = devpath; args[4] = devpath; args[5] = NULL; args[5] = NULL; rc = logwrap(5, args); rc = logwrap(5, args, 1); } else { } else { char *args[7]; char *args[7]; args[0] = MKE2FS_PATH; args[0] = MKE2FS_PATH; Loading @@ -54,7 +54,7 @@ int format_partition(blkdev_t *part, char *type) args[4] = "-v"; args[4] = "-v"; args[5] = devpath; args[5] = devpath; args[6] = NULL; args[6] = NULL; rc = logwrap(6, args); rc = logwrap(6, args, 1); } } free(devpath); free(devpath); Loading vold/logwrapper.c +20 −1 Original line number Original line Diff line number Diff line Loading @@ -100,7 +100,7 @@ void child(int argc, char* argv[]) { } } } } int logwrap(int argc, char* argv[], pid_t *childPid) int logwrap(int argc, char* argv[], pid_t *childPid, int background) { { pid_t pid; pid_t pid; Loading Loading @@ -138,6 +138,25 @@ int logwrap(int argc, char* argv[], pid_t *childPid) dup2(child_ptty, 2); dup2(child_ptty, 2); close(child_ptty); close(child_ptty); if (background) { int fd = open("/dev/cpuctl/bg_non_interactive/tasks", O_WRONLY); if (fd >=0 ) { char text[64]; sprintf(text, "%d", getpid()); if (write(fd, text, strlen(text)) < 0) { LOG(LOG_WARN, "logwrapper", "Unable to background process (%s)", strerror(errno)); close(fd); } close(fd); } else { LOG(LOG_WARN, "logwrapper", "Unable to background process (%s)", strerror(errno)); } } child(argc, argv); child(argc, argv); } else { } else { return parent(argv[0], parent_ptty); return parent(argv[0], parent_ptty); Loading vold/logwrapper.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,5 +19,5 @@ #define _LOGWRAPPER_H #define _LOGWRAPPER_H #include <stdlib.h> #include <stdlib.h> int logwrap(int argc, char* argv[]); int logwrap(int argc, char* argv[], int background); #endif #endif vold/volmgr_ext3.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -107,7 +107,7 @@ int ext_check(blkdev_t *dev) args[3] = devpath; args[3] = devpath; args[4] = NULL; args[4] = NULL; int rc = logwrap(4, args); int rc = logwrap(4, args, 1); if (rc == 0) { if (rc == 0) { LOG_VOL("filesystem '%s' had no errors", devpath); LOG_VOL("filesystem '%s' had no errors", devpath); Loading vold/volmgr_vfat.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -62,13 +62,13 @@ int vfat_check(blkdev_t *dev) args[3] = "-p"; args[3] = "-p"; args[4] = blkdev_get_devpath(dev); args[4] = blkdev_get_devpath(dev); args[5] = NULL; args[5] = NULL; rc = logwrap(5, args); rc = logwrap(5, args, 1); free(args[4]); free(args[4]); } else { } else { args[2] = "-n"; args[2] = "-n"; args[3] = blkdev_get_devpath(dev); args[3] = blkdev_get_devpath(dev); args[4] = NULL; args[4] = NULL; rc = logwrap(4, args); rc = logwrap(4, args, 1); free(args[3]); free(args[3]); } } Loading Loading
vold/format.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ int format_partition(blkdev_t *part, char *type) args[3] = "-O android"; args[3] = "-O android"; args[4] = devpath; args[4] = devpath; args[5] = NULL; args[5] = NULL; rc = logwrap(5, args); rc = logwrap(5, args, 1); } else { } else { char *args[7]; char *args[7]; args[0] = MKE2FS_PATH; args[0] = MKE2FS_PATH; Loading @@ -54,7 +54,7 @@ int format_partition(blkdev_t *part, char *type) args[4] = "-v"; args[4] = "-v"; args[5] = devpath; args[5] = devpath; args[6] = NULL; args[6] = NULL; rc = logwrap(6, args); rc = logwrap(6, args, 1); } } free(devpath); free(devpath); Loading
vold/logwrapper.c +20 −1 Original line number Original line Diff line number Diff line Loading @@ -100,7 +100,7 @@ void child(int argc, char* argv[]) { } } } } int logwrap(int argc, char* argv[], pid_t *childPid) int logwrap(int argc, char* argv[], pid_t *childPid, int background) { { pid_t pid; pid_t pid; Loading Loading @@ -138,6 +138,25 @@ int logwrap(int argc, char* argv[], pid_t *childPid) dup2(child_ptty, 2); dup2(child_ptty, 2); close(child_ptty); close(child_ptty); if (background) { int fd = open("/dev/cpuctl/bg_non_interactive/tasks", O_WRONLY); if (fd >=0 ) { char text[64]; sprintf(text, "%d", getpid()); if (write(fd, text, strlen(text)) < 0) { LOG(LOG_WARN, "logwrapper", "Unable to background process (%s)", strerror(errno)); close(fd); } close(fd); } else { LOG(LOG_WARN, "logwrapper", "Unable to background process (%s)", strerror(errno)); } } child(argc, argv); child(argc, argv); } else { } else { return parent(argv[0], parent_ptty); return parent(argv[0], parent_ptty); Loading
vold/logwrapper.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,5 +19,5 @@ #define _LOGWRAPPER_H #define _LOGWRAPPER_H #include <stdlib.h> #include <stdlib.h> int logwrap(int argc, char* argv[]); int logwrap(int argc, char* argv[], int background); #endif #endif
vold/volmgr_ext3.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -107,7 +107,7 @@ int ext_check(blkdev_t *dev) args[3] = devpath; args[3] = devpath; args[4] = NULL; args[4] = NULL; int rc = logwrap(4, args); int rc = logwrap(4, args, 1); if (rc == 0) { if (rc == 0) { LOG_VOL("filesystem '%s' had no errors", devpath); LOG_VOL("filesystem '%s' had no errors", devpath); Loading
vold/volmgr_vfat.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -62,13 +62,13 @@ int vfat_check(blkdev_t *dev) args[3] = "-p"; args[3] = "-p"; args[4] = blkdev_get_devpath(dev); args[4] = blkdev_get_devpath(dev); args[5] = NULL; args[5] = NULL; rc = logwrap(5, args); rc = logwrap(5, args, 1); free(args[4]); free(args[4]); } else { } else { args[2] = "-n"; args[2] = "-n"; args[3] = blkdev_get_devpath(dev); args[3] = blkdev_get_devpath(dev); args[4] = NULL; args[4] = NULL; rc = logwrap(4, args); rc = logwrap(4, args, 1); free(args[3]); free(args[3]); } } Loading