aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/dump_symbols.cc
diff options
context:
space:
mode:
authorluly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-05-02 19:13:09 +0000
committerluly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-05-02 19:13:09 +0000
commite219ba182e00794dee6046b01df467e030ca6390 (patch)
treed338b5898e5c3629910558113e9e20c4402d4e53 /src/common/linux/dump_symbols.cc
parentMinidump without context crashes the processor (#153). r=bryner (diff)
downloadbreakpad-e219ba182e00794dee6046b01df467e030ca6390.tar.xz
Merge Ted's patch for writing symbols to stdout for linux.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@149 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/dump_symbols.cc')
-rw-r--r--src/common/linux/dump_symbols.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index f102016d..5c2d6254 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -616,7 +616,7 @@ class MmapWrapper {
namespace google_breakpad {
bool DumpSymbols::WriteSymbolFile(const std::string &obj_file,
- const std::string &symbol_file) {
+ int sym_fd) {
int obj_fd = open(obj_file.c_str(), O_RDONLY);
if (obj_fd < 0)
return false;
@@ -636,16 +636,10 @@ bool DumpSymbols::WriteSymbolFile(const std::string &obj_file,
if (!LoadSymbols(elf_header, &symbols))
return false;
// Write to symbol file.
- int sym_fd = open(symbol_file.c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0666);
- if (sym_fd < 0)
- return false;
- FDWrapper sym_fd_wrapper(sym_fd);
if (WriteModuleInfo(sym_fd, elf_header->e_machine, obj_file) &&
DumpStabSymbols(sym_fd, symbols))
return true;
- // Remove the symbol file if failed to write the symbols.
- unlink(symbol_file.c_str());
return false;
}