Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2019 05:41:14 +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-11@freebsd.org
Subject:   svn commit: r349984 - stable/11/lib/libthr/thread
Message-ID:  <201907140541.x6E5fELD044281@repo.freebsd.org>

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

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/11/lib/libthr/thread/thr_info.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_info.c
==============================================================================
--- stable/11/lib/libthr/thread/thr_info.c	Sun Jul 14 05:40:03 2019	(r349983)
+++ stable/11/lib/libthr/thread/thr_info.c	Sun Jul 14 05:41:14 2019	(r349984)
@@ -50,7 +50,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?201907140541.x6E5fELD044281>