diff options
Diffstat (limited to 'src/util/mtp_thread.c')
-rwxr-xr-x | src/util/mtp_thread.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/mtp_thread.c b/src/util/mtp_thread.c index e96d111..e4ba76e 100755 --- a/src/util/mtp_thread.c +++ b/src/util/mtp_thread.c @@ -76,9 +76,14 @@ mtp_bool _util_thread_cancel(pthread_t tid) { mtp_int32 res; + if (tid == 0) { + ERR("tid is NULL\n"); + return FALSE; + } + res = pthread_cancel(tid); if (res != 0) { - ERR("pthread_cancel Fail [%d] errno [%d]\n", tid, errno); + ERR("pthread_cancel Fail [%d] errno [%d]\n", tid, errno); return FALSE; } |