Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2019 05:39:02 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349982 - stable/12/lib/libthr/thread
Message-ID:  <201907140539.x6E5d2Vt043317@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Jul 14 05:39:02 2019
New Revision: 349982
URL: https://svnweb.freebsd.org/changeset/base/349982

Log:
  MFC r349912:
  Restore ability to pass NULL name argument to pthread_set_name_np(3)
  to clear the thread name.
  
  PR:	239142

Modified:
  stable/12/lib/libthr/thread/thr_info.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libthr/thread/thr_info.c
==============================================================================
--- stable/12/lib/libthr/thread/thr_info.c	Sun Jul 14 03:49:48 2019	(r349981)
+++ stable/12/lib/libthr/thread/thr_info.c	Sun Jul 14 05:39:02 2019	(r349982)
@@ -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?201907140539.x6E5d2Vt043317>