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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 mach_msg_timeout_t timeout_ms; | 294 mach_msg_timeout_t timeout_ms; |
295 if (!options.has_timeout) { | 295 if (!options.has_timeout) { |
296 timeout_ms = kMachMessageTimeoutWaitIndefinitely; | 296 timeout_ms = kMachMessageTimeoutWaitIndefinitely; |
297 } else if (options.timeout_secs == 0) { | 297 } else if (options.timeout_secs == 0) { |
298 timeout_ms = kMachMessageTimeoutNonblocking; | 298 timeout_ms = kMachMessageTimeoutNonblocking; |
299 } else { | 299 } else { |
300 timeout_ms = options.timeout_secs * 1000; | 300 timeout_ms = options.timeout_secs * 1000; |
301 } | 301 } |
302 | 302 |
303 mach_msg_return_t mr = MachMessageServer::Run(&universal_mach_exc_server, | 303 mach_msg_return_t mr = MachMessageServer::Run(&universal_mach_exc_server, |
304 service_port, | 304 service_port.get(), |
305 MACH_MSG_OPTION_NONE, | 305 MACH_MSG_OPTION_NONE, |
306 options.persistent, | 306 options.persistent, |
307 receive_large, | 307 receive_large, |
308 timeout_ms); | 308 timeout_ms); |
309 if (mr == MACH_RCV_TIMED_OUT && options.has_timeout && options.persistent && | 309 if (mr == MACH_RCV_TIMED_OUT && options.has_timeout && options.persistent && |
310 exceptions_handled) { | 310 exceptions_handled) { |
311 // This is not an error: when exiting on timeout during persistent | 311 // This is not an error: when exiting on timeout during persistent |
312 // processing and at least one exception was handled, it’s considered a | 312 // processing and at least one exception was handled, it’s considered a |
313 // success. | 313 // success. |
314 } else if (mr != MACH_MSG_SUCCESS) { | 314 } else if (mr != MACH_MSG_SUCCESS) { |
315 MACH_LOG(ERROR, mr) << "MachMessageServer::Run"; | 315 MACH_LOG(ERROR, mr) << "MachMessageServer::Run"; |
316 return EXIT_FAILURE; | 316 return EXIT_FAILURE; |
317 } | 317 } |
318 | 318 |
319 return EXIT_SUCCESS; | 319 return EXIT_SUCCESS; |
320 } | 320 } |
321 | 321 |
322 } // namespace | 322 } // namespace |
323 } // namespace crashpad | 323 } // namespace crashpad |
324 | 324 |
325 int main(int argc, char* argv[]) { | 325 int main(int argc, char* argv[]) { |
326 return crashpad::CatchExceptionToolMain(argc, argv); | 326 return crashpad::CatchExceptionToolMain(argc, argv); |
327 } | 327 } |
OLD | NEW |