mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-05 18:50:06 +08:00
Return value of pthread_create is now checked.
This commit is contained in:
@@ -31,8 +31,11 @@ int mosquitto_loop_start(struct mosquitto *mosq)
|
||||
if(!mosq || mosq->threaded) return MOSQ_ERR_INVAL;
|
||||
|
||||
mosq->threaded = true;
|
||||
pthread_create(&mosq->thread_id, NULL, _mosquitto_thread_main, mosq);
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
if(!pthread_create(&mosq->thread_id, NULL, _mosquitto_thread_main, mosq)){
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
}else{
|
||||
return MOSQ_ERR_ERRNO;
|
||||
}
|
||||
#else
|
||||
return MOSQ_ERR_NOT_SUPPORTED;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user