avrdude: bugfixes

This commit is contained in:
Vojtech Kral 2018-05-07 12:05:51 +02:00
parent 07817c8ee5
commit 3d09f2a980
3 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
remove_definitions(-D_UNICODE -DUNICODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(AVRDUDE_SOURCES

View File

@ -45,6 +45,8 @@
#if !defined(WIN32NATIVE)
# include <sys/time.h>
# include <sys/types.h>
# include <sys/stat.h>
#endif
#include "avrdude.h"
@ -91,7 +93,7 @@ avrdude_message_handler_t avrdude_message_handler_set(avrdude_message_handler_t
int avrdude_message(const int msglvl, const char *format, ...)
{
static const char *format_error = "avrdude_message: Could not format message";
int rc = 0;
va_list ap;
if (verbose >= msglvl) {
@ -478,7 +480,7 @@ int avrdude_main(int argc, char * argv [], const char *sys_config)
// strcat(sys_config, "/");
// strcat(sys_config, "avrdude.conf");
// usr_config[0] = 0;
usr_config[0] = 0;
// homedir = getenv("HOME");
// if (homedir != NULL) {
// strcpy(usr_config, homedir);
@ -507,6 +509,7 @@ int avrdude_main(int argc, char * argv [], const char *sys_config)
/*
* process command line arguments
*/
optind = 1; // Reset getopt, makes it possible to use it multiple times
while ((ch = getopt(argc,argv,"?b:B:c:C:DeE:Fi:l:np:OP:qstU:uvVx:yY:")) != -1) {
switch (ch) {

View File

@ -151,7 +151,9 @@ static int wiring_open(PROGRAMMER * pgm, char * port)
strcpy(pgm->port, port);
pinfo.baud = pgm->baudrate ? pgm->baudrate: 115200;
serial_open(port, pinfo, &pgm->fd);
if (serial_open(port, pinfo, &pgm->fd) < 0) {
return -1;
}
/* If we have a snoozetime, then we wait and do NOT toggle DTR/RTS */