Commit 32754b5e authored by thestig@chromium.org's avatar thestig@chromium.org

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
parent 1aee9e0d
...@@ -332,13 +332,15 @@ pid_t UploadCrashDump(const char* filename, const char* crash_url, ...@@ -332,13 +332,15 @@ pid_t UploadCrashDump(const char* filename, const char* crash_url,
const pid_t child = sys_fork(); const pid_t child = sys_fork();
if (child) { if (child) {
sys_close(fds[1]); sys_close(fds[1]);
char buf[17]; char id_buf[17];
HANDLE_EINTR(read(fds[0], buf, sizeof(buf) - 1)); const int len = HANDLE_EINTR(read(fds[0], id_buf, sizeof(id_buf) - 1));
buf[sizeof(buf) - 1] = 0; if (len > 0) {
static const char msg[] = "\nCrash dump id: "; id_buf[len] = 0;
sys_write(2, msg, sizeof(msg) - 1); static const char msg[] = "\nCrash dump id: ";
sys_write(2, buf, my_strlen(buf)); sys_write(2, msg, sizeof(msg) - 1);
sys_write(2, "\n", 1); sys_write(2, id_buf, my_strlen(buf));
sys_write(2, "\n", 1);
}
sys_unlink(filename); sys_unlink(filename);
sys_unlink(buf); sys_unlink(buf);
sys__exit(0); sys__exit(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment