summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-11-25 19:56:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-25 19:56:53 +0000
commit0e6d8a3ab4f001e43566ad30ed636cc727bcb6c7 (patch)
treedaeab18ace12180ed5615409e4a05da34f2ff995 /fastboot
parentb69d7d40be50f9edd324158eaeb1a50680cafbde (diff)
parent87fdfc718e9eccdd9c40e7bca7a48af40b6bf732 (diff)
downloadcore-0e6d8a3ab4f001e43566ad30ed636cc727bcb6c7.tar.gz
core-0e6d8a3ab4f001e43566ad30ed636cc727bcb6c7.tar.bz2
core-0e6d8a3ab4f001e43566ad30ed636cc727bcb6c7.zip
am 87fdfc71: am cb321921: Merge "fastboot: add parameter for unbuffered stderr/stdout"
* commit '87fdfc718e9eccdd9c40e7bca7a48af40b6bf732': fastboot: add parameter for unbuffered stderr/stdout
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index 019d16fee..be11fd0ec 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -978,6 +978,7 @@ int main(int argc, char **argv)
unsigned sz;
int status;
int c;
+ int longindex;
const struct option longopts[] = {
{"base", required_argument, 0, 'b'},
@@ -986,13 +987,14 @@ int main(int argc, char **argv)
{"ramdisk_offset", required_argument, 0, 'r'},
{"tags_offset", required_argument, 0, 't'},
{"help", 0, 0, 'h'},
+ {"unbuffered", 0, 0, 0},
{0, 0, 0, 0}
};
serial = getenv("ANDROID_SERIAL");
while (1) {
- c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:h", longopts, NULL);
+ c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:h", longopts, &longindex);
if (c < 0) {
break;
}
@@ -1053,6 +1055,12 @@ int main(int argc, char **argv)
break;
case '?':
return 1;
+ case 0:
+ if (strcmp("unbuffered", longopts[longindex].name) == 0) {
+ setvbuf(stdout, NULL, _IONBF, 0);
+ setvbuf(stderr, NULL, _IONBF, 0);
+ }
+ break;
default:
abort();
}