diff options
Diffstat (limited to 'apps/plugins/rockboy/loader.c')
-rw-r--r-- | apps/plugins/rockboy/loader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/rockboy/loader.c b/apps/plugins/rockboy/loader.c index ad7c309bd8..dc89cddf8b 100644 --- a/apps/plugins/rockboy/loader.c +++ b/apps/plugins/rockboy/loader.c | |||
@@ -218,7 +218,7 @@ int sram_save(void) | |||
218 | /* If we crash before we ever loaded sram, DO NOT SAVE! */ | 218 | /* If we crash before we ever loaded sram, DO NOT SAVE! */ |
219 | if (!mbc.batt || !sramfile || !ram.loaded || !mbc.ramsize) | 219 | if (!mbc.batt || !sramfile || !ram.loaded || !mbc.ramsize) |
220 | return -1; | 220 | return -1; |
221 | fd = open(sramfile, O_WRONLY|O_CREAT); | 221 | fd = open(sramfile, O_WRONLY|O_CREAT|O_TRUNC); |
222 | // snprintf(meow,499,"Opening %s %d",sramfile,fd); | 222 | // snprintf(meow,499,"Opening %s %d",sramfile,fd); |
223 | // rb->splash(HZ*2, true, meow); | 223 | // rb->splash(HZ*2, true, meow); |
224 | if (fd<0) return -1; | 224 | if (fd<0) return -1; |
@@ -240,7 +240,7 @@ void state_save(int n) | |||
240 | if (n < 0) n = 0; | 240 | if (n < 0) n = 0; |
241 | snprintf(name, 499,"%s.%03d", saveprefix, n); | 241 | snprintf(name, 499,"%s.%03d", saveprefix, n); |
242 | 242 | ||
243 | if ((fd = open(name, O_WRONLY|O_CREAT)>=0)) | 243 | if ((fd = open(name, O_WRONLY|O_CREAT|O_TRUNC)>=0)) |
244 | { | 244 | { |
245 | savestate(fd); | 245 | savestate(fd); |
246 | close(fd); | 246 | close(fd); |
@@ -272,7 +272,7 @@ void rtc_save(void) | |||
272 | { | 272 | { |
273 | int fd; | 273 | int fd; |
274 | if (!rtc.batt) return; | 274 | if (!rtc.batt) return; |
275 | if ((fd = open(rtcfile, O_WRONLY|O_CREAT))<0) return; | 275 | if ((fd = open(rtcfile, O_WRONLY|O_CREAT|O_TRUNC))<0) return; |
276 | rtc_save_internal(fd); | 276 | rtc_save_internal(fd); |
277 | close(fd); | 277 | close(fd); |
278 | } | 278 | } |