Merge pull request #9727 from ton31337/feature/catch_struct_thread_xxx_against_NULL_coccinelle

bgpd: Don't set NULL for struct thread at bgp_dump_interval_func()
This commit is contained in:
Igor Ryzhov 2021-10-08 11:40:07 +03:00 committed by GitHub
commit b1e27fbba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,13 +165,11 @@ static int bgp_dump_interval_add(struct bgp_dump *bgp_dump, int interval)
interval = interval
- secs_into_day % interval; /* always > 0 */
}
bgp_dump->t_interval = NULL;
thread_add_timer(bm->master, bgp_dump_interval_func, bgp_dump,
interval, &bgp_dump->t_interval);
} else {
/* One-off dump: execute immediately, don't affect any scheduled
* dumps */
bgp_dump->t_interval = NULL;
thread_add_event(bm->master, bgp_dump_interval_func, bgp_dump,
0, &bgp_dump->t_interval);
}
@ -453,7 +451,6 @@ static int bgp_dump_interval_func(struct thread *t)
{
struct bgp_dump *bgp_dump;
bgp_dump = THREAD_ARG(t);
bgp_dump->t_interval = NULL;
/* Reschedule dump even if file couldn't be opened this time... */
if (bgp_dump_open_file(bgp_dump) != NULL) {