diff --git a/src/neon/neon.cc b/src/neon/neon.cc index 0bfd7d8..09669cd 100644 --- a/src/neon/neon.cc +++ b/src/neon/neon.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -789,7 +790,11 @@ int64_t NeonFile::try_fread (void * ptr, int64_t size, int64_t nmemb, bool & dat { m_reader_status.reading = true; AUDDBG ("<%p> Starting reader thread\n", this); - pthread_create (& m_reader, nullptr, reader_thread, this); + if (pthread_create (& m_reader, nullptr, reader_thread, this) != 0) + { + AUDERR ("Can not create thread: %s!\n", strerror(errno)); + return 0; + } m_reader_status.status = NEON_READER_RUN; } else if (ret == FILL_BUFFER_EOF) diff --git a/src/scrobbler2/scrobbler.cc b/src/scrobbler2/scrobbler.cc index 9c44b94..f84fbab 100644 --- a/src/scrobbler2/scrobbler.cc +++ b/src/scrobbler2/scrobbler.cc @@ -8,6 +8,8 @@ */ #include +#include +#include //audacious includes #include @@ -15,7 +17,7 @@ #include #include #include - +#include //plugin includes #include "scrobbler.h" @@ -251,7 +253,10 @@ bool Scrobbler::init () } } - pthread_create(&communicator, nullptr, scrobbling_thread, nullptr); + if (pthread_create(&communicator, nullptr, scrobbling_thread, nullptr) != 0) { + AUDERR ("Can not create thread: %s!\n", strerror(errno)); + return false; + } hook_associate("playback stop", (HookFunction) stopped, nullptr); hook_associate("playback end", (HookFunction) ended, nullptr);