Skip to content

Commit 0217bed

Browse files
committed
fscache: add key for GIT_TRACE_FSCACHE
Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 4af28e2 commit 0217bed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/win32/fscache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ static int initialized;
77
static volatile long enabled;
88
static struct hashmap map;
99
static CRITICAL_SECTION mutex;
10+
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
1011

1112
/*
1213
* An entry in the file system cache. Used for both entire directory listings
@@ -191,6 +192,8 @@ static struct fsentry *fsentry_create_list(const struct fsentry *dir)
191192
if (h == INVALID_HANDLE_VALUE) {
192193
err = GetLastError();
193194
errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
195+
trace_printf_key(&trace_fscache, "fscache: error(%d) '%.*s'\n",
196+
errno, dir->len, dir->name);
194197
return NULL;
195198
}
196199

@@ -392,6 +395,7 @@ int fscache_enable(int enable)
392395
fscache_clear();
393396
LeaveCriticalSection(&mutex);
394397
}
398+
trace_printf_key(&trace_fscache, "fscache: enable(%d)\n", enable);
395399
return result;
396400
}
397401

0 commit comments

Comments
 (0)