mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
bugfix: saving errno of ioctl() call in a temporary variable to prevent overwriting by following avrdude_message() call
This commit is contained in:
@@ -93,9 +93,10 @@ static int linuxspi_spi_duplex(const PROGRAMMER *pgm, const unsigned char *tx, u
|
||||
errno = 0;
|
||||
ret = ioctl(fd_spidev, SPI_IOC_MESSAGE(1), &tr);
|
||||
if (ret != len) {
|
||||
int ioctl_errno = errno;
|
||||
avrdude_message(MSG_INFO, "\n%s: unable to send SPI message", progname);
|
||||
if (errno)
|
||||
avrdude_message(MSG_INFO, ". %s", strerror(errno));
|
||||
if (ioctl_errno)
|
||||
avrdude_message(MSG_INFO, ". %s", strerror(ioctl_errno));
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user