diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 02:57:10 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 02:57:10 +0000 |
commit | 32754b5ee0bdece0782c0fdff7bebfc1c01f0865 (patch) | |
tree | 61a0578fac47efa8cd2db442967d2a774987e81e | |
parent | 1aee9e0dc1b5319f6402f9362eecb359bccaf406 (diff) | |
download | chromium_src-32754b5ee0bdece0782c0fdff7bebfc1c01f0865.zip chromium_src-32754b5ee0bdece0782c0fdff7bebfc1c01f0865.tar.gz chromium_src-32754b5ee0bdece0782c0fdff7bebfc1c01f0865.tar.bz2 |
A bit more clean up for Linux upload crash dump.
BUG=none
TEST=visit about:crash, no dump file left over in /tmp.
Review URL: http://codereview.chromium.org/113984
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17161 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/breakpad_linux.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 0a64a50..0985bd4 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -332,13 +332,15 @@ pid_t UploadCrashDump(const char* filename, const char* crash_url, 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); |