diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-09 13:41:46 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-09 14:30:43 -0500 |
| commit | b8dccd94f3d7408812240c375ea9885147300e70 (patch) | |
| tree | e01531c949473a45f42c1b8e573a2645398bdc7b /lib/frr_pthread.c | |
| parent | 17c7cb4acd01c76ceb9daa667857169e28540993 (diff) | |
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 <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/frr_pthread.c')
| -rw-r--r-- | lib/frr_pthread.c | 2 |
1 files changed, 2 insertions, 0 deletions
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)); |
