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

Side by Side Diff: src/client/linux/crash_generation/crash_generation_server.cc

Issue 1137423004: Fix file descriptor leaks in linux CrashGenerationServer (Closed) Base URL: https://chromium.googlesource.com/external/google-breakpad@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 Google Inc. 1 // Copyright (c) 2010 Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 assert(pthread_self() != thread_); 116 assert(pthread_self() != thread_);
117 117
118 if (!started_) 118 if (!started_)
119 return; 119 return;
120 120
121 HANDLE_EINTR(write(control_pipe_out_, &kCommandQuit, 1)); 121 HANDLE_EINTR(write(control_pipe_out_, &kCommandQuit, 1));
122 122
123 void* dummy; 123 void* dummy;
124 pthread_join(thread_, &dummy); 124 pthread_join(thread_, &dummy);
125 125
126 close(control_pipe_in_);
127 close(control_pipe_out_);
128
126 started_ = false; 129 started_ = false;
127 } 130 }
128 131
129 //static 132 //static
130 bool 133 bool
131 CrashGenerationServer::CreateReportChannel(int* server_fd, int* client_fd) 134 CrashGenerationServer::CreateReportChannel(int* server_fd, int* client_fd)
132 { 135 {
133 int fds[2]; 136 int fds[2];
134 137
135 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds)) 138 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds))
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 324
322 // static 325 // static
323 void* 326 void*
324 CrashGenerationServer::ThreadMain(void *arg) 327 CrashGenerationServer::ThreadMain(void *arg)
325 { 328 {
326 reinterpret_cast<CrashGenerationServer*>(arg)->Run(); 329 reinterpret_cast<CrashGenerationServer*>(arg)->Run();
327 return NULL; 330 return NULL;
328 } 331 }
329 332
330 } // namespace google_breakpad 333 } // namespace google_breakpad
OLDNEW
« 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