Skip to content

Commit 12ca251

Browse files
committed
Revert "e" flag for fopen
clang-tidy added it in commit ac0b191. The "e" flag is an extension for glibc which sets the O_CLOEXEC flag, so the file handle is not leaked to child processes. It is not needed here. Signed-off-by: Stefan Weil <[email protected]>
1 parent eda953c commit 12ca251

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/ccutil/genericvector.h

+2-18
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,7 @@ using FileWriter = bool (*)(const GenericVector<char>&, const STRING&);
374374
// returning false on error.
375375
inline bool LoadDataFromFile(const char* filename, GenericVector<char>* data) {
376376
bool result = false;
377-
FILE* fp = nullptr;
378-
379-
// For MSVC
380-
#if defined(_MSC_VER)
381-
fp = fopen(filename, "rb");
382-
#else
383-
fp = fopen(filename, "rbe");
384-
#endif
385-
377+
FILE* fp = fopen(filename, "rb");
386378
if (fp != nullptr) {
387379
fseek(fp, 0, SEEK_END);
388380
long size = ftell(fp);
@@ -408,15 +400,7 @@ inline bool LoadDataFromFile(const STRING& filename,
408400
// returning false on error.
409401
inline bool SaveDataToFile(const GenericVector<char>& data,
410402
const STRING& filename) {
411-
FILE* fp = nullptr;
412-
413-
// For MSVC
414-
#if defined(_MSC_VER)
415-
fp = fopen(filename.string(), "wb");
416-
#else
417-
fp = fopen(filename.string(), "wbe");
418-
#endif
419-
403+
FILE* fp = fopen(filename.string(), "wb");
420404
if (fp == nullptr) {
421405
return false;
422406
}

0 commit comments

Comments
 (0)