Remove ASSERT_IS_NOT_FORKED_CHILD from open_cloexec

This was tripping initialization order checks from ASAN, and is
otherwise not a very useful check here.
This commit is contained in:
ridiculousfish
2020-06-07 19:58:52 -07:00
parent 3cfe113a60
commit 462313f930

View File

@@ -166,11 +166,10 @@ int open_cloexec(const std::string &path, int flags, mode_t mode) {
}
int open_cloexec(const char *path, int flags, mode_t mode) {
ASSERT_IS_NOT_FORKED_CHILD();
int fd;
// Prefer to use O_CLOEXEC.
#ifdef O_CLOEXEC
// Prefer to use O_CLOEXEC. It has to both be defined and nonzero.
fd = open(path, flags | O_CLOEXEC, mode);
#else
fd = open(path, flags, mode);