From 202683a4fc148dc228de226e9980a3f27754b854 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 Jun 2016 16:15:58 +0200 Subject: Use O_CLOEXEC in most places --- src/libutil/hash.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libutil/hash.cc') diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index c17f1c4d5150..69ea95852c3f 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -254,7 +254,7 @@ Hash hashFile(HashType ht, const Path & path) Hash hash(ht); start(ht, ctx); - AutoCloseFD fd = open(path.c_str(), O_RDONLY); + AutoCloseFD fd = open(path.c_str(), O_RDONLY | O_CLOEXEC); if (fd == -1) throw SysError(format("opening file ‘%1%’") % path); unsigned char buf[8192]; -- cgit 1.4.1