diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-11-25 23:18:53 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-11-25 23:18:53 +0000 |
commit | f2f5b7c85107e2108f9bd0fa4aef63c84057917f (patch) | |
tree | fa8246c72cfceac51c6171f94f17176649bd3341 /apps | |
parent | cfda097394d752fde3b75ec2561ba752cd682e54 (diff) |
Add a simple sanity check before checking for changed binary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23753 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/misc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index 307592e346..939de440b6 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -609,9 +609,19 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame #endif #ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN case SYS_FS_CHANGED: + { + /* simple sanity: assume rockbox is on the first hotswappable + * driver, abort out if that one isn't inserted */ + int i; + for (i = 0; i < NUM_DRIVES; i++) + { + if (storage_removable(i) && !storage_present(i)) + return SYS_FS_CHANGED; + } system_flush(); check_bootfile(true); /* state gotten in main.c:init() */ system_restore(); + } return SYS_FS_CHANGED; #endif #ifdef HAVE_HEADPHONE_DETECTION |