about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutil/util.cc2
-rw-r--r--src/libutil/util.hh2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 7dc6fe72a41d..595e7243ec1a 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -216,7 +216,7 @@ DirEntries readDirectory(const Path & path)
         checkInterrupt();
         string name = dirent->d_name;
         if (name == "." || name == "..") continue;
-        entries.emplace_back(DirEntry({ name, dirent->d_ino, dirent->d_type }));
+        entries.emplace_back(name, dirent->d_ino, dirent->d_type);
     }
     if (errno) throw SysError(format("reading directory `%1%'") % path);
 
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 42215eb1d365..ade52c354076 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -69,6 +69,8 @@ struct DirEntry
     string name;
     ino_t ino;
     unsigned char type; // one of DT_*
+    DirEntry(const string & name, ino_t ino, unsigned char type)
+        : name(name), ino(ino), type(type) { }
 };
 
 typedef vector<DirEntry> DirEntries;