From 55f1d9486fcff6ae7af6cac3a0200a996c194c6c Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Tue, 24 Feb 2015 16:55:26 -0500 Subject: Fix warnings in firmware/screendump.c Change-Id: If01caf8a124e925b308bdefc6327420dde355ac9 --- firmware/screendump.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/firmware/screendump.c b/firmware/screendump.c index e27360b137..226d08a390 100644 --- a/firmware/screendump.c +++ b/firmware/screendump.c @@ -140,7 +140,11 @@ void screen_dump(void) } else { - write(fd, bmpheader, sizeof(bmpheader)); + if(write(fd, bmpheader, sizeof(bmpheader)) != sizeof(bmpheader)) + { + close(fd); + return; + } /* BMP image goes bottom up */ for (y = LCD_HEIGHT - 1; y >= 0; y--) @@ -243,7 +247,11 @@ void screen_dump(void) while (dst < dst_end); #endif /* LCD_DEPTH */ - write(fd, linebuf, DUMP_BMP_LINESIZE); + if(write(fd, linebuf, DUMP_BMP_LINESIZE) != DUMP_BMP_LINESIZE) + { + close(fd); + return; + } } } close(fd); -- cgit v1.2.3