Commit ab1c217f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

Skip the safe-assert dep on FileUtil

Summary: [Folly] Skip the safe-assert dep on FileUtil since it really needs only the combinators.

Reviewed By: Orvid

Differential Revision: D22699899

fbshipit-source-id: 73485439e397c10210d09eacbb38116e3e0a50a0
parent b37af6c5
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include <algorithm> #include <algorithm>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/FileUtil.h> #include <folly/detail/FileUtilDetail.h>
#include <folly/portability/Unistd.h>
namespace folly { namespace folly {
namespace detail { namespace detail {
...@@ -442,11 +443,14 @@ constexpr std::pair<int, const char*> errors[] = { ...@@ -442,11 +443,14 @@ constexpr std::pair<int, const char*> errors[] = {
#undef FOLLY_DETAIL_ERROR #undef FOLLY_DETAIL_ERROR
void writeStderr(const char* s, size_t len) { void writeStderr(const char* s, size_t len) {
writeFull(STDERR_FILENO, s, len); fileutil_detail::wrapFull(write, STDERR_FILENO, const_cast<char*>(s), len);
} }
void writeStderr(const char* s) { void writeStderr(const char* s) {
writeStderr(s, strlen(s)); writeStderr(s, strlen(s));
} }
void flushStderr() {
fileutil_detail::wrapNoInt(fsync, STDERR_FILENO);
}
} // namespace } // namespace
...@@ -484,7 +488,7 @@ void assertionFailure( ...@@ -484,7 +488,7 @@ void assertionFailure(
writeStderr(")"); writeStderr(")");
} }
writeStderr("\n"); writeStderr("\n");
fsyncNoInt(STDERR_FILENO); flushStderr();
abort(); abort();
} }
......
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