summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-11-11 20:28:54 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-11-11 20:41:27 +0100
commit7cc91e67a3f4dc16bec63fbaac097719d401a578 (patch)
tree1e003886f820d89f3d37ad9d2de6f33636f5d19f /lib
parentMerge pull request #10006 from chiragshah6/evpn_dev (diff)
downloadfrr-7cc91e67a3f4dc16bec63fbaac097719d401a578.tar.xz
frr-7cc91e67a3f4dc16bec63fbaac097719d401a578.zip
*: Convert quagga_signal_X to frr_signal_X
Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libfrr.h2
-rw-r--r--lib/sigevent.c34
-rw-r--r--lib/sigevent.h16
-rw-r--r--lib/thread.c2
4 files changed, 27 insertions, 27 deletions
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 3dc5d7af8..ed7e9c099 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -94,7 +94,7 @@ struct frr_daemon_info {
const char *copyright;
char startinfo[128];
- struct quagga_signal_t *signals;
+ struct frr_signal_t *signals;
size_t n_signals;
struct zebra_privs_t *privs;
diff --git a/lib/sigevent.c b/lib/sigevent.c
index 6710527ae..00bc31f51 100644
--- a/lib/sigevent.c
+++ b/lib/sigevent.c
@@ -36,10 +36,10 @@
/* master signals descriptor struct */
-static struct quagga_sigevent_master_t {
+static struct frr_sigevent_master_t {
struct thread *t;
- struct quagga_signal_t *signals;
+ struct frr_signal_t *signals;
int sigc;
volatile sig_atomic_t caught;
@@ -48,10 +48,10 @@ static struct quagga_sigevent_master_t {
/* Generic signal handler
* Schedules signal event thread
*/
-static void quagga_signal_handler(int signo)
+static void frr_signal_handler(int signo)
{
int i;
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
for (i = 0; i < sigmaster.sigc; i++) {
sig = &(sigmaster.signals[i]);
@@ -91,9 +91,9 @@ bool frr_sigevent_check(sigset_t *setp)
}
/* check if signals have been caught and run appropriate handlers */
-int quagga_sigevent_process(void)
+int frr_sigevent_process(void)
{
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
int i;
#ifdef SIGEVENT_BLOCK_SIGNALS
/* shouldn't need to block signals, but potentially may be needed */
@@ -110,7 +110,7 @@ int quagga_sigevent_process(void)
if ((sigprocmask(SIG_BLOCK, &newmask, &oldmask)) < 0) {
flog_err_sys(EC_LIB_SYSTEM_CALL,
- "quagga_signal_timer: couldnt block signals!");
+ "frr_signal_timer: couldnt block signals!");
return -1;
}
#endif /* SIGEVENT_BLOCK_SIGNALS */
@@ -143,15 +143,15 @@ int quagga_sigevent_process(void)
#ifdef SIGEVENT_SCHEDULE_THREAD
/* timer thread to check signals. shouldn't be needed */
-int quagga_signal_timer(struct thread *t)
+int frr_signal_timer(struct thread *t)
{
- struct quagga_sigevent_master_t *sigm;
+ struct frr_sigevent_master_t *sigm;
sigm = THREAD_ARG(t);
sigm->t = NULL;
- thread_add_timer(sigm->t->master, quagga_signal_timer, &sigmaster,
- QUAGGA_SIGNAL_TIMER_INTERVAL, &sigm->t);
- return quagga_sigevent_process();
+ thread_add_timer(sigm->t->master, frr_signal_timer, &sigmaster,
+ FRR_SIGNAL_TIMER_INTERVAL, &sigm->t);
+ return frr_sigevent_process();
}
#endif /* SIGEVENT_SCHEDULE_THREAD */
@@ -163,7 +163,7 @@ static int signal_set(int signo)
struct sigaction sig;
struct sigaction osig;
- sig.sa_handler = &quagga_signal_handler;
+ sig.sa_handler = &frr_signal_handler;
sigfillset(&sig.sa_mask);
sig.sa_flags = 0;
if (signo == SIGALRM) {
@@ -348,11 +348,11 @@ static void trap_default_signals(void)
}
void signal_init(struct thread_master *m, int sigc,
- struct quagga_signal_t signals[])
+ struct frr_signal_t signals[])
{
int i = 0;
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
/* First establish some default handlers that can be overridden by
the application. */
@@ -370,7 +370,7 @@ void signal_init(struct thread_master *m, int sigc,
#ifdef SIGEVENT_SCHEDULE_THREAD
sigmaster.t = NULL;
- thread_add_timer(m, quagga_signal_timer, &sigmaster,
- QUAGGA_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
+ thread_add_timer(m, frr_signal_timer, &sigmaster,
+ FRR_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
#endif /* SIGEVENT_SCHEDULE_THREAD */
}
diff --git a/lib/sigevent.h b/lib/sigevent.h
index 4a39b2288..dd1ee9958 100644
--- a/lib/sigevent.h
+++ b/lib/sigevent.h
@@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _QUAGGA_SIGNAL_H
-#define _QUAGGA_SIGNAL_H
+#ifndef _FRR_SIGNAL_H
+#define _FRR_SIGNAL_H
#include <thread.h>
@@ -29,9 +29,9 @@
extern "C" {
#endif
-#define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
+#define FRR_SIGNAL_TIMER_INTERVAL 2L
-struct quagga_signal_t {
+struct frr_signal_t {
int signal; /* signal number */
void (*handler)(void); /* handler to call */
@@ -42,11 +42,11 @@ struct quagga_signal_t {
* takes:
* - pointer to valid struct thread_master
* - number of elements in passed in signals array
- * - array of quagga_signal_t's describing signals to handle
+ * - array of frr_signal_t's describing signals to handle
* and handlers to use for each signal
*/
extern void signal_init(struct thread_master *m, int sigc,
- struct quagga_signal_t *signals);
+ struct frr_signal_t *signals);
/*
@@ -58,10 +58,10 @@ extern void signal_init(struct thread_master *m, int sigc,
bool frr_sigevent_check(sigset_t *setp);
/* check whether there are signals to handle, process any found */
-extern int quagga_sigevent_process(void);
+extern int frr_sigevent_process(void);
#ifdef __cplusplus
}
#endif
-#endif /* _QUAGGA_SIGNAL_H */
+#endif /* _FRR_SIGNAL_H */
diff --git a/lib/thread.c b/lib/thread.c
index 5dbba6363..7b223ed6d 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1695,7 +1695,7 @@ struct thread *thread_fetch(struct thread_master *m, struct thread *fetch)
do {
/* Handle signals if any */
if (m->handle_signals)
- quagga_sigevent_process();
+ frr_sigevent_process();
pthread_mutex_lock(&m->mtx);