aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump_stackwalk.cc
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-09-08 16:41:17 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-09-08 16:41:17 +0000
commit6dd21d3baf490a34af0b1b1f5a48f8443dcb1ea6 (patch)
treec17055e78b878f16e9773bcf3fe377bd4c700777 /src/processor/minidump_stackwalk.cc
parentaddressing follow-up review comments from mark (#17) (diff)
downloadbreakpad-6dd21d3baf490a34af0b1b1f5a48f8443dcb1ea6.tar.xz
Change interface for providing files to Minidump (#19). r=bryner
- Interface change: Minidump constructor now accepts a const string& path argument instead of int fd. Minidump will open the file on first Read and close it upon destruction. - Adapt callers to new interface, no longer leaking file descriptors. http://groups.google.com/group/airbag-dev/browse_thread/thread/ff24dbcde7db8ae3 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@20 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump_stackwalk.cc')
-rw-r--r--src/processor/minidump_stackwalk.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc
index db4437cd..b6049b8b 100644
--- a/src/processor/minidump_stackwalk.cc
+++ b/src/processor/minidump_stackwalk.cc
@@ -17,23 +17,16 @@
//
// Author: Mark Mentovai
-#include <errno.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
-#ifndef _WIN32
-#include <unistd.h>
-#define O_BINARY 0
-#else // !_WIN32
-#include <io.h>
-#define open _open
-#endif // !_WIN32
+
+#include <string>
#include "processor/minidump.h"
#include "processor/stackwalker_x86.h"
+using std::string;
using namespace google_airbag;
@@ -43,13 +36,7 @@ int main(int argc, char** argv) {
exit(1);
}
- int fd = open(argv[1], O_RDONLY | O_BINARY);
- if (fd == -1) {
- fprintf(stderr, "open failed\n");
- exit(1);
- }
-
- Minidump minidump(fd);
+ Minidump minidump(argv[1]);
if (!minidump.Read()) {
fprintf(stderr, "minidump.Read() failed\n");
exit(1);