From 74c1f65d9503ee9edf9a29d059948b2e6b08201c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 31 Dec 2020 19:19:56 +0000 Subject: Minor code tidy --- netfs/lib/entCache.impl.h | 12 ++++-------- 1 file 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::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::fillCache() const @@ -111,9 +109,8 @@ EntCache::fillCache() const Lock(lock); setpwent(); idcache->clear(); - std::array buf {}; - struct passwd pwbuf { - }, *pwp; + std::array buf {}; + passwd pwbuf {}, *pwp; while (getpwent_r(&pwbuf, buf.data(), buf.size(), &pwp) == 0) { idcache->insert(std::make_shared(pwp->pw_uid, pwp->pw_name, pwp->pw_gid)); } @@ -129,10 +126,9 @@ EntCache::fillCache() const { Lock(lock); setgrent(); - std::array buf {}; + std::array buf {}; idcache->clear(); - struct group grpbuf { - }, *grp; + group grpbuf {}, *grp; EntCache instance; while (getgrent_r(&grpbuf, buf.data(), buf.size(), &grp) == 0) { auto g = std::make_shared(grp->gr_gid, grp->gr_name); -- cgit v1.2.3