summaryrefslogtreecommitdiffstats
path: root/uisimulator/common
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-09-13 20:53:32 +0000
committerJens Arnold <amiconn@rockbox.org>2007-09-13 20:53:32 +0000
commit5128080328b74f78ff8e03a4fc4b3d0f4b305601 (patch)
tree22466a9e32b76902e7fd10dcb995f27c9840a89e /uisimulator/common
parent22df2fd0bf69d8dc781fee646f9115a8fcc0d969 (diff)
downloadrockbox-5128080328b74f78ff8e03a4fc4b3d0f4b305601.tar.gz
rockbox-5128080328b74f78ff8e03a4fc4b3d0f4b305601.tar.bz2
rockbox-5128080328b74f78ff8e03a4fc4b3d0f4b305601.zip
FS #7752 by Catalin Patulea: Stop 'Rockbox Info' from crashing multivolume target simulators (Ondio, Sansa).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14684 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common')
-rw-r--r--uisimulator/common/io.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index 3ad93dc382..73eda239ff 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -53,6 +53,7 @@
#include "kernel.h"
#include "debug.h"
#include "config.h"
+#include "ata.h" /* for IF_MV2 et al. */
/* Windows (and potentially other OSes) distinguish binary and text files.
* Define a dummy for the others. */
@@ -559,8 +560,19 @@ long sim_filesize(int fd)
#endif
}
-void fat_size(unsigned int* size, unsigned int* free)
+void fat_size(IF_MV2(int volume,) unsigned long* size, unsigned long* free)
{
+#ifdef HAVE_MULTIVOLUME
+ if (volume != 0) {
+ debugf("io.c: fat_size(volume=%d); simulator only supports volume 0\n",
+ volume);
+
+ if (size) *size = 0;
+ if (free) *free = 0;
+ return;
+ }
+#endif
+
#ifdef WIN32
long secperclus, bytespersec, free_clusters, num_clusters;