summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpackaging/mtp-responder.spec2
-rwxr-xr-xsrc/util/mtp_thread.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/packaging/mtp-responder.spec b/packaging/mtp-responder.spec
index 8317525..4d27366 100755
--- a/packaging/mtp-responder.spec
+++ b/packaging/mtp-responder.spec
@@ -5,7 +5,7 @@ ExcludeArch: %arm aarch64
Name: mtp-responder
Summary: Media Transfer Protocol daemon (responder)
-Version: 0.0.24
+Version: 0.0.25
Release: 1
Group: Network & Connectivity/Other
License: Apache-2.0
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;
}