diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2019-03-02 15:00:46 -0300 |
|---|---|---|
| committer | Renato Westphal <renatowestphal@gmail.com> | 2019-03-29 11:32:21 -0300 |
| commit | 8f88441d717c0ded412543cceabf0ddd93ee9f09 (patch) | |
| tree | 0a460d2da46a5b910535529c92e8db2fa5ff2a74 /lib/frr_pthread.c | |
| parent | 6a534dcafcb623f1b85b5ee2a13c74faab227ced (diff) | |
| parent | 700e9faa28bbdc3460e1d7aa109b6e4acaf347b3 (diff) | |
Merge remote-tracking branch 'frr/master' into rip-vrf
Merge commit to solve a bunch of conflicts with other PRs that were
merged in the previous weeks.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/frr_pthread.c')
| -rw-r--r-- | lib/frr_pthread.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index d5a2007c4d..d7f655271b 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -47,7 +47,7 @@ static struct list *frr_pthread_list; /* ------------------------------------------------------------------------ */ -void frr_pthread_init() +void frr_pthread_init(void) { pthread_mutex_lock(&frr_pthread_list_mtx); { @@ -57,7 +57,7 @@ void frr_pthread_init() pthread_mutex_unlock(&frr_pthread_list_mtx); } -void frr_pthread_finish() +void frr_pthread_finish(void) { pthread_mutex_lock(&frr_pthread_list_mtx); { @@ -83,9 +83,9 @@ struct frr_pthread *frr_pthread_new(struct frr_pthread_attr *attr, name = (name ? name : "Anonymous thread"); fpt->name = XSTRDUP(MTYPE_FRR_PTHREAD, name); if (os_name) - snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name); + strlcpy(fpt->os_name, os_name, OS_THREAD_NAMELEN); else - snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", name); + strlcpy(fpt->os_name, name, OS_THREAD_NAMELEN); /* initialize startup synchronization primitives */ fpt->running_cond_mtx = XCALLOC( MTYPE_PTHREAD_PRIM, sizeof(pthread_mutex_t)); @@ -124,7 +124,7 @@ int frr_pthread_set_name(struct frr_pthread *fpt) #ifdef HAVE_PTHREAD_SETNAME_NP # ifdef GNU_LINUX ret = pthread_setname_np(fpt->thread, fpt->os_name); -# else /* NetBSD */ +# elif defined(__NetBSD__) ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL); # endif #elif defined(HAVE_PTHREAD_SET_NAME_NP) @@ -178,7 +178,7 @@ int frr_pthread_stop(struct frr_pthread *fpt, void **result) return ret; } -void frr_pthread_stop_all() +void frr_pthread_stop_all(void) { pthread_mutex_lock(&frr_pthread_list_mtx); { |
