Return value of pthread_create is now checked.

This commit is contained in:
Roger A. Light
2016-03-17 21:22:56 +00:00
parent 49936c8ec3
commit caa394d0fe
2 changed files with 6 additions and 2 deletions

View File

@@ -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