OLD | NEW |
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 CrashReportDatabase::OperationStatus status = | 559 CrashReportDatabase::OperationStatus status = |
560 database->PrepareNewCrashReport(&new_report); | 560 database->PrepareNewCrashReport(&new_report); |
561 if (status != CrashReportDatabase::kNoError) { | 561 if (status != CrashReportDatabase::kNoError) { |
562 return EXIT_FAILURE; | 562 return EXIT_FAILURE; |
563 } | 563 } |
564 | 564 |
565 CrashReportDatabase::CallErrorWritingCrashReport | 565 CrashReportDatabase::CallErrorWritingCrashReport |
566 call_error_writing_crash_report(database.get(), new_report); | 566 call_error_writing_crash_report(database.get(), new_report); |
567 | 567 |
568 char buf[4096]; | 568 char buf[4096]; |
569 ssize_t read_result; | 569 FileOperationResult read_result; |
570 do { | 570 do { |
571 read_result = file_reader->Read(buf, sizeof(buf)); | 571 read_result = file_reader->Read(buf, sizeof(buf)); |
572 if (read_result < 0) { | 572 if (read_result < 0) { |
573 return EXIT_FAILURE; | 573 return EXIT_FAILURE; |
574 } | 574 } |
575 if (read_result > 0 && | 575 if (read_result > 0 && |
576 !LoggingWriteFile(new_report->handle, buf, read_result)) { | 576 !LoggingWriteFile(new_report->handle, buf, read_result)) { |
577 return EXIT_FAILURE; | 577 return EXIT_FAILURE; |
578 } | 578 } |
579 } while (read_result == sizeof(buf)); | 579 } while (read_result == sizeof(buf)); |
(...skipping 25 matching lines...) Expand all Loading... |
605 | 605 |
606 #if defined(OS_POSIX) | 606 #if defined(OS_POSIX) |
607 int main(int argc, char* argv[]) { | 607 int main(int argc, char* argv[]) { |
608 return crashpad::DatabaseUtilMain(argc, argv); | 608 return crashpad::DatabaseUtilMain(argc, argv); |
609 } | 609 } |
610 #elif defined(OS_WIN) | 610 #elif defined(OS_WIN) |
611 int wmain(int argc, wchar_t* argv[]) { | 611 int wmain(int argc, wchar_t* argv[]) { |
612 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::DatabaseUtilMain); | 612 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::DatabaseUtilMain); |
613 } | 613 } |
614 #endif // OS_POSIX | 614 #endif // OS_POSIX |
OLD | NEW |