diff options
| author | Qiuwen Lu <[email protected]> | 2020-11-16 13:53:04 +0800 |
|---|---|---|
| committer | Qiuwen Lu <[email protected]> | 2020-11-16 13:53:04 +0800 |
| commit | ca9c4fa6c85349906b449ab9d4fd601752fdd1f5 (patch) | |
| tree | e2e69b16ced6c91fe50c3a5e0c6dbd0fb290b337 | |
| parent | 827ac5269acbf0b90bdad2213af207eecab146c8 (diff) | |
调整app库注册异常退出的方式,由调用raise()改为exit(),避免coredump。
| -rw-r--r-- | app/src/marsio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/marsio.c b/app/src/marsio.c index a01ddf5..938d541 100644 --- a/app/src/marsio.c +++ b/app/src/marsio.c @@ -749,7 +749,7 @@ static int __app_register_response_handler(struct ctrlmsg_handler * ct_hand, if (rep_msg->msg_err.errcode != 0) { MR_ERROR("%s", rep_msg->msg_err.strerr); - abort(); + exit(EXIT_FAILURE); } // 注册成功,唤醒等待的线程。 @@ -969,7 +969,7 @@ int marsio_init(struct mr_instance * instance, const char * appsym) return RT_SUCCESS; err: - if (instance->is_exit_when_err_raise) abort(); + if (instance->is_exit_when_err_raise) exit(EXIT_FAILURE); return RT_ERR; } @@ -1023,7 +1023,7 @@ int marsio_thread_init(struct mr_instance * instance) out: pthread_mutex_unlock(&instance->lock_thread_init); - if (ret < 0 && instance->is_exit_when_err_raise) abort(); + if (ret < 0 && instance->is_exit_when_err_raise) exit(EXIT_FAILURE); return ret; } |
