summaryrefslogtreecommitdiffstats
path: root/serial.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-09-16 22:34:25 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-09-16 22:34:25 +0000
commit8ce52327d2d825aac0e3ce784101546706321df3 (patch)
treedd8ff0f4846f741f85d58af6b553ef690c453f87 /serial.c
parent84ecc9fbfdab530ce9cc8f0de37dc956ead67c19 (diff)
downloadflashrom-8ce52327d2d825aac0e3ce784101546706321df3.zip
flashrom-8ce52327d2d825aac0e3ce784101546706321df3.tar.gz
Binary file (standard input) matches
Corresponding to flashrom svn r1178.
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