am cb321921: Merge "fastboot: add parameter for unbuffered stderr/stdout"
* commit 'cb321921fe04f6ccaeb56c4bf3e8965ee4764738': fastboot: add parameter for unbuffered stderr/stdout
This commit is contained in:
commit
87fdfc718e
1 changed files with 9 additions and 1 deletions
|
|
@ -988,6 +988,7 @@ int main(int argc, char **argv)
|
||||||
unsigned sz;
|
unsigned sz;
|
||||||
int status;
|
int status;
|
||||||
int c;
|
int c;
|
||||||
|
int longindex;
|
||||||
|
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{"base", required_argument, 0, 'b'},
|
{"base", required_argument, 0, 'b'},
|
||||||
|
|
@ -996,13 +997,14 @@ int main(int argc, char **argv)
|
||||||
{"ramdisk_offset", required_argument, 0, 'r'},
|
{"ramdisk_offset", required_argument, 0, 'r'},
|
||||||
{"tags_offset", required_argument, 0, 't'},
|
{"tags_offset", required_argument, 0, 't'},
|
||||||
{"help", 0, 0, 'h'},
|
{"help", 0, 0, 'h'},
|
||||||
|
{"unbuffered", 0, 0, 0},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
serial = getenv("ANDROID_SERIAL");
|
serial = getenv("ANDROID_SERIAL");
|
||||||
|
|
||||||
while (1) {
|
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) {
|
if (c < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1063,6 +1065,12 @@ int main(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
return 1;
|
return 1;
|
||||||
|
case 0:
|
||||||
|
if (strcmp("unbuffered", longopts[longindex].name) == 0) {
|
||||||
|
setvbuf(stdout, NULL, _IONBF, 0);
|
||||||
|
setvbuf(stderr, NULL, _IONBF, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue