mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
Partially revert the line buffered output change,
and turn stderr into unbuffered output while producing the progress report. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@765 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
8
main.c
8
main.c
@@ -134,6 +134,8 @@ static void update_progress_tty (int percent, double etime, char *hdr)
|
||||
static int last = 0;
|
||||
int i;
|
||||
|
||||
setvbuf(stderr, (char*)NULL, _IONBF, 0);
|
||||
|
||||
hashes[50] = 0;
|
||||
|
||||
memset (hashes, ' ', 50);
|
||||
@@ -156,6 +158,8 @@ static void update_progress_tty (int percent, double etime, char *hdr)
|
||||
last = 1;
|
||||
fprintf (stderr, "\n\n");
|
||||
}
|
||||
|
||||
setvbuf(stderr, (char*)NULL, _IOLBF, 0);
|
||||
}
|
||||
|
||||
static void update_progress_no_tty (int percent, double etime, char *hdr)
|
||||
@@ -164,6 +168,8 @@ static void update_progress_no_tty (int percent, double etime, char *hdr)
|
||||
static int last = 0;
|
||||
int cnt = (percent>>1)*2;
|
||||
|
||||
setvbuf(stderr, (char*)NULL, _IONBF, 0);
|
||||
|
||||
if (hdr) {
|
||||
fprintf (stderr, "\n%s | ", hdr);
|
||||
last = 0;
|
||||
@@ -183,6 +189,8 @@ static void update_progress_no_tty (int percent, double etime, char *hdr)
|
||||
}
|
||||
else
|
||||
last = (percent>>1)*2; /* Make last a multiple of 2. */
|
||||
|
||||
setvbuf(stderr, (char*)NULL, _IOLBF, 0);
|
||||
}
|
||||
|
||||
static void list_programmers_callback(const char *name, const char *desc,
|
||||
|
Reference in New Issue
Block a user