Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-05-21 16:24:24 +0300
committerVojtech Kral <vojtech@kral.hk>2018-05-21 19:58:22 +0300
commita43e72f696bcb719aa45745d96200bdaa123c4a8 (patch)
tree0d97c4d60840f58d6c54b2918334c44c3ab60e6d /xs/src/avrdude/ser_posix.c
parent4f4649d0464cfd67ccd5bb48013785612f9ceccf (diff)
Firmware updater: rework cancelling
Diffstat (limited to 'xs/src/avrdude/ser_posix.c')
-rw-r--r--xs/src/avrdude/ser_posix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xs/src/avrdude/ser_posix.c b/xs/src/avrdude/ser_posix.c
index 81e05da2e..91b18e945 100644
--- a/xs/src/avrdude/ser_posix.c
+++ b/xs/src/avrdude/ser_posix.c
@@ -340,6 +340,7 @@ static int ser_send(union filedescriptor *fd, const unsigned char * buf, size_t
}
while (len) {
+ RETURN_IF_CANCEL();
rc = write(fd->ifd, p, (len > 1024) ? 1024 : len);
if (rc < 0) {
avrdude_message(MSG_INFO, "%s: ser_send(): write error: %s\n",
@@ -370,6 +371,7 @@ static int ser_recv(union filedescriptor *fd, unsigned char * buf, size_t buflen
while (len < buflen) {
reselect:
+ RETURN_IF_CANCEL();
FD_ZERO(&rfds);
FD_SET(fd->ifd, &rfds);
@@ -458,6 +460,7 @@ static int ser_drain(union filedescriptor *fd, int display)
FD_SET(fd->ifd, &rfds);
reselect:
+ RETURN_IF_CANCEL();
nfds = select(fd->ifd + 1, &rfds, NULL, NULL, &timeout);
if (nfds == 0) {
if (display) {