diff options
-rw-r--r-- | netfs/lib/entCache.impl.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/netfs/lib/entCache.impl.h b/netfs/lib/entCache.impl.h index 0021f00..13263af 100644 --- a/netfs/lib/entCache.impl.h +++ b/netfs/lib/entCache.impl.h @@ -102,8 +102,6 @@ EntCache<entry_t>::clearFallback() User::User(uid_t u, std::string n, gid_t g) : id(u), name(std::move(n)), group(g) { } -const int BUFLEN = 8196; - template<> void EntCache<User>::fillCache() const @@ -111,9 +109,8 @@ EntCache<User>::fillCache() const Lock(lock); setpwent(); idcache->clear(); - std::array<char, BUFLEN> buf {}; - struct passwd pwbuf { - }, *pwp; + std::array<char, BUFSIZ> buf {}; + passwd pwbuf {}, *pwp; while (getpwent_r(&pwbuf, buf.data(), buf.size(), &pwp) == 0) { idcache->insert(std::make_shared<User>(pwp->pw_uid, pwp->pw_name, pwp->pw_gid)); } @@ -129,10 +126,9 @@ EntCache<Group>::fillCache() const { Lock(lock); setgrent(); - std::array<char, BUFLEN> buf {}; + std::array<char, BUFSIZ> buf {}; idcache->clear(); - struct group grpbuf { - }, *grp; + group grpbuf {}, *grp; EntCache<User> instance; while (getgrent_r(&grpbuf, buf.data(), buf.size(), &grp) == 0) { auto g = std::make_shared<Group>(grp->gr_gid, grp->gr_name); |