toolbox: getevent: disable stdout buffering
So that the getevent output can be redirected and still be responsive when events occur. A good example is when using 'adb shell getevent' command, this latter would only display the events when the buffer is full. With this patch as soon as an event is received/printed, it is flushed to stdout. Change-Id: I77eee96ed1aa59bf8d82f17eab666976ce966def Signed-off-by: Gary Bisson <gbisson@essential.com>
This commit is contained in:
parent
0ae6d74436
commit
8cbf6bb535
1 changed files with 3 additions and 0 deletions
|
@ -530,6 +530,9 @@ int getevent_main(int argc, char *argv[])
|
|||
const char *device = NULL;
|
||||
const char *device_path = "/dev/input";
|
||||
|
||||
/* disable buffering on stdout */
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
opterr = 0;
|
||||
do {
|
||||
c = getopt(argc, argv, "tns:Sv::dpilqc:rh");
|
||||
|
|
Loading…
Reference in a new issue