summaryrefslogtreecommitdiffstats
path: root/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/serial.c b/serial.c
index caf9389..9957fb4 100644
--- a/serial.c
+++ b/serial.c
@@ -200,8 +200,10 @@ int serialport_write(unsigned char *buf, unsigned int writecnt)
#else
tmp = write(sp_fd, buf, writecnt);
#endif
- if (tmp == -1)
+ if (tmp == -1) {
+ msg_perr("Serial port write error!\n");
return 1;
+ }
if (!tmp)
msg_pdbg("Empty write\n");
writecnt -= tmp;
@@ -221,8 +223,10 @@ int serialport_read(unsigned char *buf, unsigned int readcnt)
#else
tmp = read(sp_fd, buf, readcnt);
#endif
- if (tmp == -1)
+ if (tmp == -1) {
+ msg_perr("Serial port read error!\n");
return 1;
+ }
if (!tmp)
msg_pdbg("Empty read\n");
readcnt -= tmp;
OpenPOWER on IntegriCloud