Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2019 16:19:33 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349912 - head/lib/libthr/thread
Message-ID:  <201907111619.x6BGJXtc014177@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907111619.x6BGJXtc014177>