summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eina/eina_thread.c')
-rw-r--r--src/lib/eina/eina_thread.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
index 2730662cd9..3d64f5a9fe 100644
--- a/src/lib/eina/eina_thread.c
+++ b/src/lib/eina/eina_thread.c
@@ -174,7 +174,14 @@ EAPI Eina_Bool
174eina_thread_name_set(Eina_Thread t, const char *name) 174eina_thread_name_set(Eina_Thread t, const char *name)
175{ 175{
176#ifdef EINA_HAVE_PTHREAD_SETNAME 176#ifdef EINA_HAVE_PTHREAD_SETNAME
177 if (pthread_setname_np((pthread_t)t, name) == 0) return EINA_TRUE; 177 char buf[16];
178 if (name)
179 {
180 strncpy(buf, name, 15);
181 buf[15] = 0;
182 }
183 else buf[0] = 0;
184 if (pthread_setname_np((pthread_t)t, buf) == 0) return EINA_TRUE;
178#endif 185#endif
179 return EINA_FALSE; 186 return EINA_FALSE;
180} 187}