]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: On frr_pthread_new save a os_name
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 9 Jan 2019 18:41:46 +0000 (13:41 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 10 Jan 2019 13:43:48 +0000 (08:43 -0500)
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 <sharpd@cumulusnetworks.com>
lib/frr_pthread.c

index a0223730b8e4a6e87e2dbe61743c1ddd96305af5..52b85f46d29bab6ea22fc81271b2edcd07cd55a3 100644 (file)
@@ -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));