mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-15 18:21:07 +00:00
Exchange of fprintf(stderr, ...) with avrdude_message(...).
This change was made for the shared library, since library functions should not write to std-streams directly. Instead avrdude_message() has to be implemented by the library user. For the avrdude application this function is implemented in main.c. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1305 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
@@ -239,7 +239,7 @@ static int serbb_open(PROGRAMMER *pgm, char *port)
|
||||
|
||||
r = tcgetattr(pgm->fd.ifd, &mode);
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "%s: ", port);
|
||||
avrdude_message("%s: ", port);
|
||||
perror("tcgetattr");
|
||||
return(-1);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ static int serbb_open(PROGRAMMER *pgm, char *port)
|
||||
|
||||
r = tcsetattr(pgm->fd.ifd, TCSANOW, &mode);
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "%s: ", port);
|
||||
avrdude_message("%s: ", port);
|
||||
perror("tcsetattr");
|
||||
return(-1);
|
||||
}
|
||||
@@ -262,14 +262,14 @@ static int serbb_open(PROGRAMMER *pgm, char *port)
|
||||
flags = fcntl(pgm->fd.ifd, F_GETFL, 0);
|
||||
if (flags == -1)
|
||||
{
|
||||
fprintf(stderr, "%s: Can not get flags: %s\n",
|
||||
avrdude_message("%s: Can not get flags: %s\n",
|
||||
progname, strerror(errno));
|
||||
return(-1);
|
||||
}
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(pgm->fd.ifd, F_SETFL, flags) == -1)
|
||||
{
|
||||
fprintf(stderr, "%s: Can not clear nonblock flag: %s\n",
|
||||
avrdude_message("%s: Can not clear nonblock flag: %s\n",
|
||||
progname, strerror(errno));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user