summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-09-07 07:07:07 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-09-07 07:07:07 +0000
commit61fb3fd74923a53a71364148ae99b38ced2f9941 (patch)
tree1b0eeb996e3bab8ee51af96ae9b0a5c007d095ee /serial.c
parent06c35da124776661e6353e48f3b478752658dfb7 (diff)
downloadflashrom-61fb3fd74923a53a71364148ae99b38ced2f9941.tar.gz
Remove exit calls from sp_sync_read_timeout and sp_synchronize.
Add return values to sp_synchronize so we can signal a failure to the only upstream caller (serprog_init), which is prepared to propagate a failure. sp_sync_read_timeout was harder to fix because it already used a return value, but we needed to distinguish two different failure modes. This solution distinguishes them by the sign of the return values, which maintains readability as much as possible. Thanks to Niklas Söderlund for the original patch and idea. Signed-off-by: Niklas Söderlund <niso@kth.se> Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1595 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/serial.c b/serial.c
index 05c7d04..7e47dcc 100644
--- a/serial.c
+++ b/serial.c
@@ -239,6 +239,7 @@ void sp_flush_incoming(void)
#ifdef _WIN32
PurgeComm(sp_fd, PURGE_RXCLEAR);
#else
+ /* FIXME: error handling */
tcflush(sp_fd, TCIFLUSH);
#endif
return;