diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
commit | 243a6be085fe6a7ce49169864c68a8839735e49b (patch) | |
tree | abfecf3c23dc7512ca48e72ac418b149c865e0f3 /include/fstream | |
parent | 1147845301c03308e3419b89c28c77bb6917fe04 (diff) | |
download | src-243a6be085fe6a7ce49169864c68a8839735e49b.tar.gz src-243a6be085fe6a7ce49169864c68a8839735e49b.zip |
Vendor import of stripped libc++ trunk r375505, the last commit beforevendor/libc++/libc++-trunk-r375505vendor/libc++
the upstream Subversion repository was made read-only, and the LLVM
project migrated to GitHub:
https://llvm.org/svn/llvm-project/libcxx/trunk@375505
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=353946
svn path=/vendor/libc++/libc++-r375505/; revision=353947; tag=vendor/libc++/libc++-trunk-r375505
Diffstat (limited to 'include/fstream')
-rw-r--r-- | include/fstream | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/include/fstream b/include/fstream index 60a05b0d4b95..e9138998bf11 100644 --- a/include/fstream +++ b/include/fstream @@ -508,34 +508,34 @@ const char* basic_filebuf<_CharT, _Traits>::__make_mdstring( switch (__mode & ~ios_base::ate) { case ios_base::out: case ios_base::out | ios_base::trunc: - return "w"; + return "w" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::out | ios_base::app: case ios_base::app: - return "a"; + return "a" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in: - return "r"; + return "r" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out: - return "r+"; + return "r+" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out | ios_base::trunc: - return "w+"; + return "w+" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out | ios_base::app: case ios_base::in | ios_base::app: - return "a+"; + return "a+" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::out | ios_base::binary: case ios_base::out | ios_base::trunc | ios_base::binary: - return "wb"; + return "wb" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::out | ios_base::app | ios_base::binary: case ios_base::app | ios_base::binary: - return "ab"; + return "ab" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::binary: - return "rb"; + return "rb" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out | ios_base::binary: - return "r+b"; + return "r+b" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary: - return "w+b"; + return "w+b" _LIBCPP_FOPEN_CLOEXEC_MODE; case ios_base::in | ios_base::out | ios_base::app | ios_base::binary: case ios_base::in | ios_base::app | ios_base::binary: - return "a+b"; + return "a+b" _LIBCPP_FOPEN_CLOEXEC_MODE; default: return nullptr; } @@ -697,10 +697,9 @@ basic_filebuf<_CharT, _Traits>::close() unique_ptr<FILE, int(*)(FILE*)> __h(__file_, fclose); if (sync()) __rt = 0; - if (fclose(__h.release()) == 0) - __file_ = 0; - else + if (fclose(__h.release())) __rt = 0; + __file_ = 0; setbuf(0, 0); } return __rt; |