svn commit: r349912 - head/lib/libthr/thread

Konstantin Belousov kib at FreeBSD.org
Thu Jul 11 16:19:34 UTC 2019


Author: kib
Date: Thu Jul 11 16:19:33 2019
New Revision: 349912
URL: https://svnweb.freebsd.org/changeset/base/349912

Log:
  Restore ability to pass NULL name argument to pthread_set_name_np(3)
  to clear the thread name.
  
  PR:	239142
  Submitted by:	Lewis Donzis <lew at perftech.com>
  MFC after:	3 days

Modified:
  head/lib/libthr/thread/thr_info.c

Modified: head/lib/libthr/thread/thr_info.c
==============================================================================
--- head/lib/libthr/thread/thr_info.c	Thu Jul 11 15:38:40 2019	(r349911)
+++ head/lib/libthr/thread/thr_info.c	Thu Jul 11 16:19:33 2019	(r349912)
@@ -52,7 +52,7 @@ thr_set_name_np(struct pthread *thread, const char *na
 {
 
 	free(thread->name);
-	thread->name = strdup(name);
+	thread->name = name != NULL ? strdup(name) : NULL;
 }
 
 /* Set the thread name for debug. */


More information about the svn-src-all mailing list