diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-08-17 23:12:53 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-08-17 23:12:53 +0000 |
commit | b0baafc4da1f3ffb84e267dd19d176db3de1c14e (patch) | |
tree | 3953f64180195ad40e27ab834f9b175e29042025 /src/client/minidump_file_writer.cc | |
parent | Fix build errors with gcc 4.4. Patch by Silvius Rus <rus@google.com>. (diff) | |
download | breakpad-b0baafc4da1f3ffb84e267dd19d176db3de1c14e.tar.xz |
Merge of Breakpad Chrome Linux fork
A=agl, Lei Zhang
R=nealsid, agl
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@384 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/minidump_file_writer.cc')
-rw-r--r-- | src/client/minidump_file_writer.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc index fdd59198..354ffc90 100644 --- a/src/client/minidump_file_writer.cc +++ b/src/client/minidump_file_writer.cc @@ -37,6 +37,8 @@ #include <string.h> #include <unistd.h> +#include "common/linux/linux_syscall_support.h" +#include "common/linux/linux_libc_support.h" #include "client/minidump_file_writer-inl.h" #include "common/string_conversion.h" @@ -53,7 +55,11 @@ MinidumpFileWriter::~MinidumpFileWriter() { bool MinidumpFileWriter::Open(const char *path) { assert(file_ == -1); +#if __linux__ + file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); +#else file_ = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); +#endif return file_ != -1; } @@ -63,7 +69,11 @@ bool MinidumpFileWriter::Close() { if (file_ != -1) { ftruncate(file_, position_); +#if __linux__ + result = (sys_close(file_) == 0); +#else result = (close(file_) == 0); +#endif file_ = -1; } @@ -227,9 +237,16 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) { return false; // Seek and write the data - if (lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) - if (write(file_, src, size) == size) +#if __linux__ + if (sys_lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) { + if (sys_write(file_, src, size) == size) { +#else + if (lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) { + if (write(file_, src, size) == size) { +#endif return true; + } + } return false; } |