forked from Archive/PX4-Autopilot
Bugfix:pthread_create retuns 0 on success and positive error on error without errono set
This commit is contained in:
parent
a5ad7641e3
commit
05a08252ff
|
@ -98,6 +98,7 @@ UavcanServers::~UavcanServers()
|
|||
if (_mutex_inited) {
|
||||
(void)Lock::deinit(_subnode_mutex);
|
||||
}
|
||||
|
||||
_main_node.getDispatcher().removeRxFrameListener();
|
||||
}
|
||||
|
||||
|
@ -164,9 +165,9 @@ int UavcanServers::start(uavcan::INode &main_node)
|
|||
|
||||
rv = pthread_create(&_instance->_subnode_thread, &tattr, static_cast<pthread_startroutine_t>(run_trampoline), NULL);
|
||||
|
||||
if (rv < 0) {
|
||||
warnx("pthread_create() failed: %d", errno);
|
||||
rv = -errno;
|
||||
if (rv != 0) {
|
||||
rv = -rv;
|
||||
warnx("pthread_create() failed: %d", rv);
|
||||
delete _instance;
|
||||
_instance = nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue