diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-10-25 20:51:32 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-10-25 20:51:32 +0000 |
commit | d361fafb734b52810cb9b33a62c1d5b8931ed86f (patch) | |
tree | 805e59c103471eb57dcbc6090fe11ece53561d84 /gold/dwp.cc | |
parent | 598c7410cc48438cda3fdb45f11b7f2702da3097 (diff) | |
download | gdb-d361fafb734b52810cb9b33a62c1d5b8931ed86f.zip gdb-d361fafb734b52810cb9b33a62c1d5b8931ed86f.tar.gz gdb-d361fafb734b52810cb9b33a62c1d5b8931ed86f.tar.bz2 |
Issue a fatal error on bad fwrite return
* dwp.cc (Dwo_file::record_target_info): Issue a fatal error
on bad fwrite return.
Diffstat (limited to 'gold/dwp.cc')
-rw-r--r-- | gold/dwp.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gold/dwp.cc b/gold/dwp.cc index aaee465..92e3b6b 100644 --- a/gold/dwp.cc +++ b/gold/dwp.cc @@ -1458,7 +1458,9 @@ Dwp_output_file::record_target_info(const char*, int machine, // Write zeroes for the ELF header initially. We'll write // the actual header during finalize(). static const char buf[elfcpp::Elf_sizes<64>::ehdr_size] = { 0 }; - ::fwrite(buf, 1, this->next_file_offset_, this->fd_); + if (::fwrite(buf, 1, this->next_file_offset_, this->fd_) + < (size_t) this->next_file_offset_) + gold_fatal(_("%s: %s"), this->name_, strerror(errno)); } // Add a string to the debug strings section. |