1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 13:26:44 +02:00

more thorough error checking

This commit is contained in:
Jfreegman
2014-09-23 22:51:56 -04:00
parent 48cf4ebf02
commit b071a9e992
11 changed files with 93 additions and 23 deletions

View File

@ -328,8 +328,11 @@ int init_notify(int login_cooldown, int notification_timeout)
#endif /* SOUND_NOTIFY */
#if defined(SOUND_NOTIFY) || defined(BOX_NOTIFY)
pthread_mutex_init(Control.poll_mutex, NULL);
if (pthread_mutex_init(Control.poll_mutex, NULL) != 0)
return -1;
pthread_t thread;
if (pthread_create(&thread, NULL, do_playing, NULL) != 0 || pthread_detach(thread) != 0 ) {
pthread_mutex_destroy(Control.poll_mutex);
return -1;