summaryrefslogtreecommitdiff
path: root/altosui/libaltos/libaltos.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-07-29 19:34:00 -0700
committerKeith Packard <keithp@keithp.com>2012-07-29 19:34:00 -0700
commit0bf21399d3d47d58410df4c6ce89fc20fcd42c89 (patch)
treef1c39fbbc5470e7d5489f6fcef2d0fe5ac2a461e /altosui/libaltos/libaltos.c
parent59588ba34159b27c02e1a886b46497ecfa0cf4d3 (diff)
altosui: Handle Monitor Idle errors better
Deal with missing data by checking for MISSING in more places. Handle serial communication failures during send by reporting back from libaltos. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/libaltos/libaltos.c')
-rw-r--r--altosui/libaltos/libaltos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/altosui/libaltos/libaltos.c b/altosui/libaltos/libaltos.c
index 1cc27cbe..515432f9 100644
--- a/altosui/libaltos/libaltos.c
+++ b/altosui/libaltos/libaltos.c
@@ -221,7 +221,7 @@ altos_flush(struct altos_file *file)
#endif
if (ret < 0) {
altos_set_last_posix_error();
- return -errno;
+ return -last_error.code;
}
if (ret) {
memmove(file->out_data, file->out_data + ret,
@@ -247,7 +247,7 @@ altos_putchar(struct altos_file *file, char c)
ret = 0;
if (file->out_used == USB_BUF_SIZE)
ret = altos_flush(file);
- return 0;
+ return ret;
}
#ifdef USE_POLL