summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-02-28 18:32:57 +0000
committerJens Arnold <amiconn@rockbox.org>2005-02-28 18:32:57 +0000
commit399c081f939943f8a9b3f967fed6fd333a23ce22 (patch)
treec547873bda201c42a72bf12d91eb0f2962734d37 /uisimulator
parent00dd42a7135e4cadf49158e97ded8f9357941044 (diff)
downloadrockbox-399c081f939943f8a9b3f967fed6fd333a23ce22.tar.gz
rockbox-399c081f939943f8a9b3f967fed6fd333a23ce22.zip
Simulators: lseek() working again for systems with an off_t datatype differing from 'long' (cygwin/x11, maybe others). Removed unused sim_close().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6084 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index ee2ad6f14c..d85cf680ab 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -145,7 +145,6 @@ void sim_closedir(MYDIR *dir)
free(dir);
}
-
int sim_open(const char *name, int o)
{
char buffer[256]; /* sufficiently big */
@@ -153,7 +152,7 @@ int sim_open(const char *name, int o)
if(name[0] == '/') {
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
-
+
debugf("We open the real file '%s'\n", buffer);
#ifdef WIN32
return (open)(buffer, opts);
@@ -166,11 +165,6 @@ int sim_open(const char *name, int o)
return -1;
}
-int sim_close(int fd)
-{
- return (close)(fd);
-}
-
int sim_creat(const char *name, mode_t mode)
{
char buffer[256]; /* sufficiently big */
@@ -184,7 +178,7 @@ int sim_creat(const char *name, mode_t mode)
fprintf(stderr, "WARNING, bad file name lacks slash: %s\n",
name);
return -1;
-}
+}
int sim_mkdir(const char *name, mode_t mode)
{
@@ -242,13 +236,19 @@ int sim_rename(const char *oldpath, const char* newpath)
return -1;
}
-off_t sim_filesize(int fd)
+/* rockbox off_t may be different from system off_t */
+long sim_lseek(int fildes, long offset, int whence)
+{
+ return lseek(fildes, offset, whence);
+}
+
+long sim_filesize(int fd)
{
- int old = lseek(fd, 0, SEEK_CUR);
- int size = lseek(fd, 0, SEEK_END);
+ long old = lseek(fd, 0, SEEK_CUR);
+ long size = lseek(fd, 0, SEEK_END);
lseek(fd, old, SEEK_SET);
- return(size);
+ return size;
}
void fat_size(unsigned int* size, unsigned int* free)