diff options
author | Yusuke Sato <yusukes@google.com> | 2015-07-08 14:57:07 -0700 |
---|---|---|
committer | Yusuke Sato <yusukes@google.com> | 2015-07-15 10:13:51 -0700 |
commit | 0df08271fb41e13550a4f2aa1fbdeb76b9a548c6 (patch) | |
tree | d138b39b9f8d644369180651efdd8a3bac41dc1c /logwrapper/logwrap.c | |
parent | c9aeae27403db86e1ec30c953f1d0fd6ae63b184 (diff) | |
download | system_core-0df08271fb41e13550a4f2aa1fbdeb76b9a548c6.tar.gz system_core-0df08271fb41e13550a4f2aa1fbdeb76b9a548c6.tar.bz2 system_core-0df08271fb41e13550a4f2aa1fbdeb76b9a548c6.zip |
Use fsck.f2fs -a instead of -f for faster boot
and run fsck with -f on clean shutdown instead.
With -f, fsck.f2fs always performs a full scan of the /data
partition regardless of whether the partition is clean or not.
The full scan takes more than 2 seconds on volantis-userdebug
and delays the OS boot.
With -a, the command does almost nothing when the partition
is clean and finishes within 20-30ms on volantis-userdebug.
When the partition has an error or its check point has
CP_FSCK_FLAG (aka "need_fsck"), the command does exactly the
same full scan as -f to fix it.
Bug: 21853106
Change-Id: I126263caf34c0f5bb8f5e6794454d4e72526ce38
Diffstat (limited to 'logwrapper/logwrap.c')
-rw-r--r-- | logwrapper/logwrap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/logwrapper/logwrap.c b/logwrapper/logwrap.c index 3a6276e0f..777dafeff 100644 --- a/logwrapper/logwrap.c +++ b/logwrapper/logwrap.c @@ -355,7 +355,8 @@ static int parent(const char *tag, int parent_read, pid_t pid, } if (poll_fds[0].revents & POLLIN) { - sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b); + sz = TEMP_FAILURE_RETRY( + read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)); sz += b; // Log one line at a time @@ -490,7 +491,7 @@ int android_fork_execvp_ext(int argc, char* argv[], int *status, bool ignore_int } /* Use ptty instead of socketpair so that STDOUT is not buffered */ - parent_ptty = open("/dev/ptmx", O_RDWR); + parent_ptty = TEMP_FAILURE_RETRY(open("/dev/ptmx", O_RDWR)); if (parent_ptty < 0) { ERROR("Cannot create parent ptty\n"); rc = -1; @@ -505,7 +506,7 @@ int android_fork_execvp_ext(int argc, char* argv[], int *status, bool ignore_int goto err_ptty; } - child_ptty = open(child_devname, O_RDWR); + child_ptty = TEMP_FAILURE_RETRY(open(child_devname, O_RDWR)); if (child_ptty < 0) { ERROR("Cannot open child_ptty\n"); rc = -1; |