| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 sigemptyset(&sa.sa_mask); | 332 sigemptyset(&sa.sa_mask); |
| 333 sa.sa_flags = SA_SIGINFO; | 333 sa.sa_flags = SA_SIGINFO; |
| 334 sa.sa_sigaction = HandleSIGTERM; | 334 sa.sa_sigaction = HandleSIGTERM; |
| 335 int rv = sigaction(SIGTERM, &sa, &old_sa); | 335 int rv = sigaction(SIGTERM, &sa, &old_sa); |
| 336 PCHECK(rv == 0) << "sigaction"; | 336 PCHECK(rv == 0) << "sigaction"; |
| 337 reset_sigterm.reset(&old_sa); | 337 reset_sigterm.reset(&old_sa); |
| 338 } | 338 } |
| 339 #elif defined(OS_WIN) | 339 #elif defined(OS_WIN) |
| 340 ExceptionHandlerServer exception_handler_server(!options.pipe_name.empty()); | 340 ExceptionHandlerServer exception_handler_server(!options.pipe_name.empty()); |
| 341 | 341 |
| 342 std::string pipe_name; | |
| 343 if (!options.pipe_name.empty()) { | 342 if (!options.pipe_name.empty()) { |
| 344 exception_handler_server.SetPipeName(base::UTF8ToUTF16(options.pipe_name)); | 343 exception_handler_server.SetPipeName(base::UTF8ToUTF16(options.pipe_name)); |
| 345 } else if (options.handshake_handle != INVALID_HANDLE_VALUE) { | 344 } else if (options.handshake_handle != INVALID_HANDLE_VALUE) { |
| 346 std::wstring pipe_name = exception_handler_server.CreatePipe(); | 345 std::wstring pipe_name = exception_handler_server.CreatePipe(); |
| 347 | 346 |
| 348 uint32_t pipe_name_length = static_cast<uint32_t>(pipe_name.size()); | 347 uint32_t pipe_name_length = static_cast<uint32_t>(pipe_name.size()); |
| 349 if (!LoggingWriteFile(options.handshake_handle, | 348 if (!LoggingWriteFile(options.handshake_handle, |
| 350 &pipe_name_length, | 349 &pipe_name_length, |
| 351 sizeof(pipe_name_length))) { | 350 sizeof(pipe_name_length))) { |
| 352 return EXIT_FAILURE; | 351 return EXIT_FAILURE; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 373 database.get(), &upload_thread, &options.annotations); | 372 database.get(), &upload_thread, &options.annotations); |
| 374 | 373 |
| 375 exception_handler_server.Run(&exception_handler); | 374 exception_handler_server.Run(&exception_handler); |
| 376 | 375 |
| 377 upload_thread.Stop(); | 376 upload_thread.Stop(); |
| 378 | 377 |
| 379 return EXIT_SUCCESS; | 378 return EXIT_SUCCESS; |
| 380 } | 379 } |
| 381 | 380 |
| 382 } // namespace crashpad | 381 } // namespace crashpad |
| OLD | NEW |