Commit 300f64f9 authored by Philip Pronin's avatar Philip Pronin Committed by Anton Likhtarov

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
parent c7f8903c
...@@ -123,7 +123,7 @@ bool readFile(const char* file_name, Container& out, ...@@ -123,7 +123,7 @@ bool readFile(const char* file_name, Container& out,
"readFile: only containers with byte-sized elements accepted"); "readFile: only containers with byte-sized elements accepted");
assert(file_name); assert(file_name);
const auto fd = open(file_name, O_RDONLY); const auto fd = openNoInt(file_name, O_RDONLY);
if (fd == -1) return false; if (fd == -1) return false;
size_t soFar = 0; // amount of bytes successfully read size_t soFar = 0; // amount of bytes successfully read
...@@ -131,7 +131,7 @@ bool readFile(const char* file_name, Container& out, ...@@ -131,7 +131,7 @@ bool readFile(const char* file_name, Container& out,
assert(out.size() >= soFar); // resize better doesn't throw assert(out.size() >= soFar); // resize better doesn't throw
out.resize(soFar); out.resize(soFar);
// Ignore errors when closing the file // Ignore errors when closing the file
close(fd); closeNoInt(fd);
}; };
// Obtain file size: // Obtain file size:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment