fix(dwarfsc): there's nothing in errno if ostream is bad() or fail()

This commit is contained in:
Marcus Holland-Moritz 2024-01-13 11:19:16 +01:00
parent bc8ff4ebce
commit 73b4680cf4

View File

@ -19,7 +19,6 @@
* along with dwarfs. If not, see <https://www.gnu.org/licenses/>. * along with dwarfs. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include <cerrno>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <string_view> #include <string_view>
@ -154,7 +153,7 @@ int dwarfsck_main(int argc, sys_char** argv, iolayer const& iol) {
#endif #endif
iol.out.write(reinterpret_cast<char const*>(hdr->data()), hdr->size()); iol.out.write(reinterpret_cast<char const*>(hdr->data()), hdr->size());
if (iol.out.bad() || iol.out.fail()) { if (iol.out.bad() || iol.out.fail()) {
LOG_ERROR << "error writing header: " << ::strerror(errno); LOG_ERROR << "error writing header";
return 1; return 1;
} }
} else { } else {