0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 07:20:55 +01:00

ircd::fs: Rotate more internal bufs in case of reentrance.

This commit is contained in:
Jason Volk 2019-03-15 15:36:59 -07:00
parent aae00eab7f
commit fbe06f5724

View file

@ -1844,8 +1844,11 @@ ircd::fs::debug_paths()
const char *
ircd::fs::path_str(const string_view &s)
{
thread_local char buf[PATH_MAX_LEN + 1];
return data(strlcpy(buf, s));
static const size_t buf_sz{PATH_MAX_LEN}, buf_cnt{4};
thread_local char buf[buf_cnt][buf_sz];
thread_local size_t i{0};
return data(strlcpy(buf[i++ % buf_cnt], s));
}
uint