Merge pull request #5043 from alyssais/vexing

libutil: use uniform initialization in _deletePath
This commit is contained in:
Eelco Dolstra 2021-07-27 09:54:24 +02:00 committed by GitHub
commit 9deeab6337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);