From 32dc4dacbcc94ff0bb962028c68a8a1acbed68ee Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 9 Jan 2019 13:41:46 -0500 Subject: lib: On frr_pthread_new save a os_name On call of frr_pthread_new, save the os_name if given, if not given use the name passed in( shortening to fit in available space ) and finally if the name was not passed in use the default value. Signed-off-by: Donald Sharp --- lib/frr_pthread.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/frr_pthread.c') diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index a0223730b8..52b85f46d2 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -84,6 +84,8 @@ struct frr_pthread *frr_pthread_new(struct frr_pthread_attr *attr, fpt->name = XSTRDUP(MTYPE_FRR_PTHREAD, name); if (os_name) snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name); + else + snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", name); /* initialize startup synchronization primitives */ fpt->running_cond_mtx = XCALLOC( MTYPE_PTHREAD_PRIM, sizeof(pthread_mutex_t)); -- cgit v1.2.3