rockbox/firmware
Michael McAllister fae5c8d067 x1000: don't close fd 0 when a bootloader backup fails early
backup_bootloader() and restore_bootloader() initialise `fd = 0` and their error paths close it unconditionally. Any failure before the file is opened updater_init(), or the size check between them therefore reaches close(0) and closes whatever fd 0 happens to be. On a native target that is whatever the filesystem layer handed out first, so an unrelated open file is closed and the damage surfaces somewhere else entirely.

Initialise to -1 instead, which is the value close() ignores.

Found by inspection while bringing up another Ingenic target. Not run on
X1000 hardware.

Change-Id: Ib043f79f0b7edc7c70ccd77cbff54e264ed2b2de
Co-Authored-By: Claude Opus 4.8
2026-08-10 15:20:49 -04:00
..
asm asm: ARMv7-M: replace unity-gain write_samples() asm with memcpy 2026-07-15 22:56:05 -04:00
common FS#13876 strcasestr doesn't finds utf8 characters 2026-07-31 20:34:39 -04:00
drivers axp2101: fix the enable test in axp2101_supply_get_voltage() 2026-08-10 14:32:54 -04:00
export ipod6g: Add inline earphone remote support 2026-08-05 08:40:24 -04:00
include chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
kernel kernel: avoid divide-by-zero in thread_get_debug_info() for zero-size stacks 2026-07-22 09:34:04 -04:00
libc chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
reggen stm32h743: implement timer API 2026-07-11 17:23:36 -04:00
target x1000: don't close fd 0 when a bootloader backup fails early 2026-08-10 15:20:49 -04:00
usbstack iap: Improve IAPGeneralCommandID_RequestIPodName 2026-08-07 08:48:05 -04:00
arabjoin.c
arabjoin.h unicode: Support characters beyond the first unicode plane 2025-09-12 09:24:30 -04:00
ata_idle_notify.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
backlight-sw-fading.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
backlight.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
bidi.c bidi: do not pass non-ASCII codepoints to ispunct() 2026-07-01 21:03:38 -04:00
buflib_malloc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
buflib_mempool.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
chunk_alloc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
COPYING
core_alloc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
debug.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
eeprom_settings.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
elf_loader.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
enc_base.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
events.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
firmware.make chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
font.c FS#13944 - FONT_UI loads the last loaded font not global_status.font_id 2026-06-30 13:29:23 -04:00
font_cache.c unicode: Support characters beyond the first unicode plane 2025-09-12 09:24:30 -04:00
general.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
hangul.c unicode: Support characters beyond the first unicode plane 2025-09-12 09:24:30 -04:00
lc-rock.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
linuxboot.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
logf.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lru.c
panic.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pcm.c fix yellow from 59a42fbf61 2026-06-10 11:28:04 -04:00
pcm_mixer.c pcm_mixer: fix active_channels handling in mixer_handle_sampr_change 2026-07-23 21:17:13 -04:00
pcm_sampr.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pcm_sw_volume.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
powermgmt.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
profile.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
README
rolo.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rom.lds h300: add support for ROM image generation 2020-10-26 01:37:42 +00:00
screendump.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
scroll_engine.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sdmmc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sound.c audiohw: remove unused BALANCE_CAP and CLIPPING_CAP 2026-07-20 12:47:12 -04:00
SOURCES ipod6g: Add inline earphone remote support 2026-08-05 08:40:24 -04:00
storage.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
system.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
timer.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
tuner.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb.c usb: Fix warning introduced in f11c89aae2 2026-07-03 14:45:21 -04:00

See docs/README