Allow setting the panic hook with parity-clib (#9292)
* Allow setting the panic hook with parity-clib * Make all FFI functions unsafe * Fix comment * Fix concern
This commit is contained in:
committed by
Marek Kotewicz
parent
30e40079ca
commit
1564fae011
@@ -57,7 +57,6 @@ extern crate ethcore_transaction as transaction;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
extern crate kvdb;
|
||||
extern crate panic_hook;
|
||||
extern crate parity_hash_fetch as hash_fetch;
|
||||
extern crate parity_ipfs_api;
|
||||
extern crate parity_local_store as local_store;
|
||||
|
||||
@@ -253,7 +253,8 @@ fn main_direct(force_can_restart: bool) -> i32 {
|
||||
panic_hook::set_with({
|
||||
let e = exit.clone();
|
||||
let exiting = exiting.clone();
|
||||
move || {
|
||||
move |panic_msg| {
|
||||
let _ = stdio::stderr().write_all(panic_msg.as_bytes());
|
||||
if !exiting.swap(true, Ordering::SeqCst) {
|
||||
*e.0.lock() = ExitStatus {
|
||||
panicking: true,
|
||||
|
||||
Reference in New Issue
Block a user