diff options
author | Michael Hohmuth <sideral@rockbox.org> | 2011-04-16 13:06:18 +0000 |
---|---|---|
committer | Michael Hohmuth <sideral@rockbox.org> | 2011-04-16 13:06:18 +0000 |
commit | e7f5013988c416bc78a13eda9bf28a3c213f22b3 (patch) | |
tree | 74d2faa2bb67e77f38494dce35ae66f484c911eb /uisimulator/common/io.c | |
parent | cf223b98adadeb8b0c29ea604cd049f7798b5012 (diff) | |
download | rockbox-e7f5013988c416bc78a13eda9bf28a3c213f22b3.tar.gz rockbox-e7f5013988c416bc78a13eda9bf28a3c213f22b3.zip |
Fix regression in r29715: files listed multiple times in uisimulator
Fixes FS#12066.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29717 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common/io.c')
-rw-r--r-- | uisimulator/common/io.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index fd30dc68b6..3212fa50fe 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -147,6 +147,8 @@ extern int _wrmdir(const wchar_t*); | |||
147 | 147 | ||
148 | 148 | ||
149 | #ifdef HAVE_DIRCACHE | 149 | #ifdef HAVE_DIRCACHE |
150 | struct dircache_entry; | ||
151 | const struct dircache_entry *dircache_get_entry_ptr(const char *filename); | ||
150 | void dircache_add_file(const char *name, long startcluster); | 152 | void dircache_add_file(const char *name, long startcluster); |
151 | void dircache_remove(const char *name); | 153 | void dircache_remove(const char *name); |
152 | void dircache_rename(const char *oldname, const char *newname); | 154 | void dircache_rename(const char *oldname, const char *newname); |
@@ -391,7 +393,7 @@ int sim_open(const char *name, int o, ...) | |||
391 | mode_t mode = va_arg(ap, unsigned int); | 393 | mode_t mode = va_arg(ap, unsigned int); |
392 | ret = OPEN(get_sim_pathname(name), opts, mode); | 394 | ret = OPEN(get_sim_pathname(name), opts, mode); |
393 | #ifdef HAVE_DIRCACHE | 395 | #ifdef HAVE_DIRCACHE |
394 | if (ret >= 0) | 396 | if (ret >= 0 && !dircache_get_entry_ptr(name)) |
395 | dircache_add_file(name, 0); | 397 | dircache_add_file(name, 0); |
396 | #endif | 398 | #endif |
397 | va_end(ap); | 399 | va_end(ap); |
@@ -418,7 +420,7 @@ int sim_creat(const char *name, mode_t mode) | |||
418 | int ret = OPEN(get_sim_pathname(name), | 420 | int ret = OPEN(get_sim_pathname(name), |
419 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); | 421 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); |
420 | #ifdef HAVE_DIRCACHE | 422 | #ifdef HAVE_DIRCACHE |
421 | if (ret >= 0) | 423 | if (ret >= 0 && !dircache_get_entry_ptr(name)) |
422 | dircache_add_file(name, 0); | 424 | dircache_add_file(name, 0); |
423 | #endif | 425 | #endif |
424 | return ret; | 426 | return ret; |