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:
parent
7d70684811
commit
56783f0ac2
|
@ -1,3 +1,9 @@
|
|||
2007-11-08 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Partially revert the line buffered output change,
|
||||
and turn stderr into unbuffered output while producing the
|
||||
progress report.
|
||||
|
||||
2007-11-07 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Add setup and teardown hooks to the programmer
|
||||
|
|
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,
|
||||
|
|
Loading…
Reference in New Issue