am a91968fd: Merge "Accept socket connection before tracing." into lmp-dev

* commit 'a91968fd099378d1673c7443be16adcb97ee40af':
  Accept socket connection before tracing.
This commit is contained in:
Christopher Ferris 2014-10-02 01:16:58 +00:00 committed by Android Git Automerger
commit f625a249b9

View File

@ -438,6 +438,12 @@ int main(int argc, char *argv[]) {
} }
} }
// If we are going to use a socket, do it as early as possible
// to avoid timeouts from bugreport.
if (use_socket) {
redirect_to_socket(stdout, "dumpstate");
}
/* open the vibrator before dropping root */ /* open the vibrator before dropping root */
FILE *vibrator = 0; FILE *vibrator = 0;
if (do_vibrate) { if (do_vibrate) {
@ -504,9 +510,7 @@ int main(int argc, char *argv[]) {
char path[PATH_MAX], tmp_path[PATH_MAX]; char path[PATH_MAX], tmp_path[PATH_MAX];
pid_t gzip_pid = -1; pid_t gzip_pid = -1;
if (use_socket) { if (!use_socket && use_outfile) {
redirect_to_socket(stdout, "dumpstate");
} else if (use_outfile) {
strlcpy(path, use_outfile, sizeof(path)); strlcpy(path, use_outfile, sizeof(path));
if (do_add_date) { if (do_add_date) {
char date[80]; char date[80];