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:
@@ -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>
|
2007-11-07 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||||
|
|
||||||
* main.c: Add setup and teardown hooks to the programmer
|
* 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;
|
static int last = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
setvbuf(stderr, (char*)NULL, _IONBF, 0);
|
||||||
|
|
||||||
hashes[50] = 0;
|
hashes[50] = 0;
|
||||||
|
|
||||||
memset (hashes, ' ', 50);
|
memset (hashes, ' ', 50);
|
||||||
@@ -156,6 +158,8 @@ static void update_progress_tty (int percent, double etime, char *hdr)
|
|||||||
last = 1;
|
last = 1;
|
||||||
fprintf (stderr, "\n\n");
|
fprintf (stderr, "\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setvbuf(stderr, (char*)NULL, _IOLBF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_progress_no_tty (int percent, double etime, char *hdr)
|
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;
|
static int last = 0;
|
||||||
int cnt = (percent>>1)*2;
|
int cnt = (percent>>1)*2;
|
||||||
|
|
||||||
|
setvbuf(stderr, (char*)NULL, _IONBF, 0);
|
||||||
|
|
||||||
if (hdr) {
|
if (hdr) {
|
||||||
fprintf (stderr, "\n%s | ", hdr);
|
fprintf (stderr, "\n%s | ", hdr);
|
||||||
last = 0;
|
last = 0;
|
||||||
@@ -183,6 +189,8 @@ static void update_progress_no_tty (int percent, double etime, char *hdr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
last = (percent>>1)*2; /* Make last a multiple of 2. */
|
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,
|
static void list_programmers_callback(const char *name, const char *desc,
|
||||||
|
Reference in New Issue
Block a user