Skip to content

Commit 65a467f

Browse files
committed
fixup??? Win32: add a cache below mingw's lstat and dirent implementations
Made necessary by `ew/hashmap`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5081a4d commit 65a467f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compat/win32/fscache.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static void fsentry_init(struct fsentry *fse, struct fsentry *list,
111111
fse->list = list;
112112
fse->name = name;
113113
fse->len = len;
114-
hashmap_entry_init(fse, fsentry_hash(fse));
114+
hashmap_entry_init(&fse->ent, fsentry_hash(fse));
115115
}
116116

117117
/*
@@ -328,7 +328,7 @@ static void fscache_add(struct fscache *cache, struct fsentry *fse)
328328
fse = fse->list;
329329

330330
for (; fse; fse = fse->next)
331-
hashmap_add(&cache->map, fse);
331+
hashmap_add(&cache->map, &fse->ent);
332332
}
333333

334334
/*
@@ -370,7 +370,7 @@ static struct fsentry *fscache_get(struct fscache *cache, struct fsentry *key)
370370

371371
cache->fscache_requests++;
372372
/* check if entry is in cache */
373-
fse = hashmap_get(&cache->map, key, NULL);
373+
fse = hashmap_get_entry(&cache->map, key, ent, NULL);
374374
if (fse) {
375375
if (fse->st_mode)
376376
fsentry_addref(fse);
@@ -380,7 +380,7 @@ static struct fsentry *fscache_get(struct fscache *cache, struct fsentry *key)
380380
}
381381
/* if looking for a file, check if directory listing is in cache */
382382
if (!fse && key->list) {
383-
fse = hashmap_get(&cache->map, key->list, NULL);
383+
fse = hashmap_get_entry(&cache->map, key->list, ent, NULL);
384384
if (fse) {
385385
/*
386386
* dir entry without file entry, or dir does not
@@ -416,7 +416,7 @@ static struct fsentry *fscache_get(struct fscache *cache, struct fsentry *key)
416416

417417
/* lookup file entry if requested (fse already points to directory) */
418418
if (key->list)
419-
fse = hashmap_get(&cache->map, key, NULL);
419+
fse = hashmap_get_entry(&cache->map, key, ent, NULL);
420420

421421
if (fse && !fse->st_mode)
422422
fse = NULL; /* non-existing directory */

0 commit comments

Comments
 (0)