OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #define SYS_SEGMENTNAME "syscalls" // For linux_syscall_support.h | 5 #define SYS_SEGMENTNAME "syscalls" // For linux_syscall_support.h |
6 | 6 |
7 #include "chrome/app/breakpad_linux.h" | 7 #include "chrome/app/breakpad_linux.h" |
8 | 8 |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 551 } |
552 | 552 |
553 IGNORE_RET(sys_close(fds[0])); | 553 IGNORE_RET(sys_close(fds[0])); |
554 IGNORE_RET(sys_dup2(fds[1], 3)); | 554 IGNORE_RET(sys_dup2(fds[1], 3)); |
555 static const char* const kWgetBinary = "/usr/bin/wget"; | 555 static const char* const kWgetBinary = "/usr/bin/wget"; |
556 const char* args[] = { | 556 const char* args[] = { |
557 kWgetBinary, | 557 kWgetBinary, |
558 header, | 558 header, |
559 post_file, | 559 post_file, |
560 kUploadURL, | 560 kUploadURL, |
| 561 "--timeout=10", // Set a timeout so we don't hang forever. |
| 562 "--tries=1", // Don't retry if the upload fails. |
561 "-O", // output reply to fd 3 | 563 "-O", // output reply to fd 3 |
562 "/dev/fd/3", | 564 "/dev/fd/3", |
563 NULL, | 565 NULL, |
564 }; | 566 }; |
565 | 567 |
566 execve(kWgetBinary, const_cast<char**>(args), environ); | 568 execve(kWgetBinary, const_cast<char**>(args), environ); |
567 static const char msg[] = "Cannot upload crash dump: cannot exec " | 569 static const char msg[] = "Cannot upload crash dump: cannot exec " |
568 "/usr/bin/wget\n"; | 570 "/usr/bin/wget\n"; |
569 sys_write(2, msg, sizeof(msg) - 1); | 571 sys_write(2, msg, sizeof(msg) - 1); |
570 sys__exit(1); | 572 sys__exit(1); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 struct timeval tv; | 766 struct timeval tv; |
765 if (!gettimeofday(&tv, NULL)) | 767 if (!gettimeofday(&tv, NULL)) |
766 uptime = timeval_to_ms(&tv); | 768 uptime = timeval_to_ms(&tv); |
767 else | 769 else |
768 uptime = 0; | 770 uptime = 0; |
769 } | 771 } |
770 | 772 |
771 bool IsCrashReporterEnabled() { | 773 bool IsCrashReporterEnabled() { |
772 return is_crash_reporter_enabled; | 774 return is_crash_reporter_enabled; |
773 } | 775 } |
OLD | NEW |