diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2012-04-03 20:59:11 +0200 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2012-04-03 20:59:11 +0200 |
commit | 9ca9b657e4f1d9481cc795422d74274abf9d41f1 (patch) | |
tree | 58d3f14094bcff5bc8c08c588f2e3931f9222578 | |
parent | 1207c7b6416084624aeeb78ba8222d9a4ca49d94 (diff) | |
download | rockbox-9ca9b657e4f1d9481cc795422d74274abf9d41f1.tar.gz rockbox-9ca9b657e4f1d9481cc795422d74274abf9d41f1.zip |
Revert 1207c7b and fix the actual warnings.
The warnings 1207c7b was supposed to get rid of are sim-only. This
means the binsize argument used for the _FORTIFY_SOURCE fix did not
apply at all. This one actually checks the return values.
Change-Id: Ic4cd8c25de4305310baa868c077a66981cdfcb4b
-rw-r--r-- | firmware/target/hosted/sdl/lcd-charcells.c | 12 | ||||
-rwxr-xr-x | tools/configure | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/firmware/target/hosted/sdl/lcd-charcells.c b/firmware/target/hosted/sdl/lcd-charcells.c index 9ceb5de391..3a623827db 100644 --- a/firmware/target/hosted/sdl/lcd-charcells.c +++ b/firmware/target/hosted/sdl/lcd-charcells.c | |||
@@ -167,7 +167,11 @@ void screen_dump(void) | |||
167 | if (fd < 0) | 167 | if (fd < 0) |
168 | return; | 168 | return; |
169 | 169 | ||
170 | write(fd, bmpheader, sizeof(bmpheader)); | 170 | if(write(fd, bmpheader, sizeof(bmpheader)) != sizeof(bmpheader)) |
171 | { | ||
172 | close(fd); | ||
173 | return; | ||
174 | } | ||
171 | SDL_LockSurface(lcd_surface); | 175 | SDL_LockSurface(lcd_surface); |
172 | 176 | ||
173 | /* BMP image goes bottom up */ | 177 | /* BMP image goes bottom up */ |
@@ -191,7 +195,11 @@ void screen_dump(void) | |||
191 | dst_mask = 0x80; | 195 | dst_mask = 0x80; |
192 | } | 196 | } |
193 | } | 197 | } |
194 | write(fd, line, sizeof(line)); | 198 | if(write(fd, line, sizeof(line)) != sizeof(line)) |
199 | { | ||
200 | close(fd); | ||
201 | return; | ||
202 | } | ||
195 | } | 203 | } |
196 | SDL_UnlockSurface(lcd_surface); | 204 | SDL_UnlockSurface(lcd_surface); |
197 | close(fd); | 205 | close(fd); |
diff --git a/tools/configure b/tools/configure index ed3f0a4938..b682cbd223 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -3827,8 +3827,6 @@ if test -n "$t_cpu"; then | |||
3827 | elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree | 3827 | elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree |
3828 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" | 3828 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" |
3829 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" | 3829 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" |
3830 | #disable _FORTIFY_SOURCE for simulator builds | ||
3831 | GCCOPTS="$GCCOPTS -U_FORTIFY_SOURCE" | ||
3832 | fi | 3830 | fi |
3833 | 3831 | ||
3834 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" | 3832 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" |