From: Philip Pronin Date: Fri, 30 May 2014 07:05:28 +0000 (-0700) Subject: use NoInt() wrappers in FileUtil X-Git-Tag: v0.22.0~522 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=300f64f9e5414ac5147b4b86c3c16822ec78b49d;p=folly.git use NoInt() wrappers in FileUtil Summary: Accidentally spotted this problem. `folly/FileUtil.h` and `common/files/FileUtil.h` are now using `*NoInt` wrappers where appropriate. Test Plan: fbconfig -r common/files folly && fbmake opt -j32 Reviewed By: lucian@fb.com Subscribers: folly@lists, fbcode-common-diffs@lists FB internal diff: D1356261 --- diff --git a/folly/FileUtil.h b/folly/FileUtil.h index 13dbe5a0..4eb56df3 100644 --- a/folly/FileUtil.h +++ b/folly/FileUtil.h @@ -123,7 +123,7 @@ bool readFile(const char* file_name, Container& out, "readFile: only containers with byte-sized elements accepted"); assert(file_name); - const auto fd = open(file_name, O_RDONLY); + const auto fd = openNoInt(file_name, O_RDONLY); if (fd == -1) return false; size_t soFar = 0; // amount of bytes successfully read @@ -131,7 +131,7 @@ bool readFile(const char* file_name, Container& out, assert(out.size() >= soFar); // resize better doesn't throw out.resize(soFar); // Ignore errors when closing the file - close(fd); + closeNoInt(fd); }; // Obtain file size: