diff options
Diffstat (limited to 'uisimulator/common')
-rw-r--r-- | uisimulator/common/io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index d094feee6b..71da4fc2ce 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -148,8 +148,7 @@ extern int _wrmdir(const wchar_t*); | |||
148 | 148 | ||
149 | 149 | ||
150 | #ifdef HAVE_DIRCACHE | 150 | #ifdef HAVE_DIRCACHE |
151 | struct dircache_entry; | 151 | int dircache_get_entry_id(const char *filename); |
152 | const struct dircache_entry *dircache_get_entry_ptr(const char *filename); | ||
153 | void dircache_add_file(const char *name, long startcluster); | 152 | void dircache_add_file(const char *name, long startcluster); |
154 | void dircache_remove(const char *name); | 153 | void dircache_remove(const char *name); |
155 | void dircache_rename(const char *oldname, const char *newname); | 154 | void dircache_rename(const char *oldname, const char *newname); |
@@ -409,7 +408,7 @@ int sim_open(const char *name, int o, ...) | |||
409 | mode_t mode = va_arg(ap, unsigned int); | 408 | mode_t mode = va_arg(ap, unsigned int); |
410 | ret = OPEN(get_sim_pathname(name), opts, mode); | 409 | ret = OPEN(get_sim_pathname(name), opts, mode); |
411 | #ifdef HAVE_DIRCACHE | 410 | #ifdef HAVE_DIRCACHE |
412 | if (ret >= 0 && !dircache_get_entry_ptr(name)) | 411 | if (ret >= 0 && (dircache_get_entry_id(name) < 0)) |
413 | dircache_add_file(name, 0); | 412 | dircache_add_file(name, 0); |
414 | #endif | 413 | #endif |
415 | va_end(ap); | 414 | va_end(ap); |
@@ -436,7 +435,7 @@ int sim_creat(const char *name, mode_t mode) | |||
436 | int ret = OPEN(get_sim_pathname(name), | 435 | int ret = OPEN(get_sim_pathname(name), |
437 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); | 436 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); |
438 | #ifdef HAVE_DIRCACHE | 437 | #ifdef HAVE_DIRCACHE |
439 | if (ret >= 0 && !dircache_get_entry_ptr(name)) | 438 | if (ret >= 0 && (dircache_get_entry_id(name) < 0)) |
440 | dircache_add_file(name, 0); | 439 | dircache_add_file(name, 0); |
441 | #endif | 440 | #endif |
442 | return ret; | 441 | return ret; |