diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-07-24 09:19:48 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-07-24 09:19:48 +0000 |
commit | 369ed71858b50529242fd0b9d274cc13b96ded05 (patch) | |
tree | 219486a9a3339a3e2b75c575ee6f431f3153be49 /src | |
parent | 97be92569ca8294a8bc0977cb59ce7dcbdbc6c36 (diff) |
libutil: use uniform initialization in _deletePath
Otherwise I get a compiler error when building for NetBSD:
src/libutil/util.cc: In function 'void nix::_deletePath(const Path&, uint64_t&)':
src/libutil/util.cc:438:17: error: base operand of '->' is not a pointer
438 | AutoCloseFD dirfd(open(dir.c_str(), O_RDONLY));
| ^~~~~
src/libutil/util.cc:439:10: error: 'dirfd' was not declared in this scope
439 | if (!dirfd) {
| ^~~~~
src/libutil/util.cc:444:17: error: 'dirfd' was not declared in this scope
444 | _deletePath(dirfd.get(), path, bytesFreed);
| ^~~~~
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/util.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index b8334defc..d876315c8 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -435,7 +435,7 @@ static void _deletePath(const Path & path, uint64_t & bytesFreed) if (dir == "") dir = "/"; - AutoCloseFD dirfd(open(dir.c_str(), O_RDONLY)); + AutoCloseFD dirfd{open(dir.c_str(), O_RDONLY)}; if (!dirfd) { if (errno == ENOENT) return; throw SysError("opening directory '%1%'", path); |