diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-09 13:41:46 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-10 08:43:48 -0500 |
| commit | 32dc4dacbcc94ff0bb962028c68a8a1acbed68ee (patch) | |
| tree | a11a6583b5b881074627a50b08b7351f4d7296a7 | |
| parent | 8de312fd4ea87ac344162234c13abc68b8b20cd9 (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>
| -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)); |
