Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4099)

Unified Diff: chrome/app/breakpad_linux.cc

Issue 113984: A bit more clean up for Linux upload crash dump.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix off by 1 error Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_linux.cc
===================================================================
--- chrome/app/breakpad_linux.cc (revision 17156)
+++ chrome/app/breakpad_linux.cc (working copy)
@@ -332,13 +332,15 @@
const pid_t child = sys_fork();
if (child) {
sys_close(fds[1]);
- char buf[17];
- HANDLE_EINTR(read(fds[0], buf, sizeof(buf) - 1));
- buf[sizeof(buf) - 1] = 0;
- static const char msg[] = "\nCrash dump id: ";
- sys_write(2, msg, sizeof(msg) - 1);
- sys_write(2, buf, my_strlen(buf));
- sys_write(2, "\n", 1);
+ char id_buf[17];
+ const int len = HANDLE_EINTR(read(fds[0], id_buf, sizeof(id_buf) - 1));
+ if (len > 0) {
+ id_buf[len] = 0;
+ static const char msg[] = "\nCrash dump id: ";
+ sys_write(2, msg, sizeof(msg) - 1);
+ sys_write(2, id_buf, my_strlen(buf));
+ sys_write(2, "\n", 1);
+ }
sys_unlink(filename);
sys_unlink(buf);
sys__exit(0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698