mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Flock: misc
This commit is contained in:
parent
4bc6d4f466
commit
7b4b471d5a
@ -1,6 +1,7 @@
|
|||||||
#include "flock/flock.h"
|
#include "flock/flock.h"
|
||||||
|
|
||||||
#include "lib/obstacle.h"
|
#include "lib/obstacle.h"
|
||||||
|
#include "lib/runtime.h"
|
||||||
#include "lib/string.h"
|
#include "lib/string.h"
|
||||||
#include "lib/timer.h"
|
#include "lib/timer.h"
|
||||||
#include "sysdep/unix/unix.h"
|
#include "sysdep/unix/unix.h"
|
||||||
@ -11,6 +12,7 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <stdatomic.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@ -160,6 +162,10 @@ main(int argc, char **argv, char **argh UNUSED)
|
|||||||
|
|
||||||
birdloop_init();
|
birdloop_init();
|
||||||
|
|
||||||
|
struct global_runtime gr = *atomic_load_explicit(&global_runtime, memory_order_relaxed);
|
||||||
|
// gr.latency_debug = ~0;
|
||||||
|
switch_runtime(&gr);
|
||||||
|
|
||||||
ev_init_list(&global_event_list, &main_birdloop, "Global event list");
|
ev_init_list(&global_event_list, &main_birdloop, "Global event list");
|
||||||
ev_init_list(&global_work_list, &main_birdloop, "Global work list");
|
ev_init_list(&global_work_list, &main_birdloop, "Global work list");
|
||||||
ev_init_list(&main_birdloop.event_list, &main_birdloop, "Global fast event list");
|
ev_init_list(&main_birdloop.event_list, &main_birdloop, "Global fast event list");
|
||||||
|
@ -196,6 +196,13 @@ hypervisor_exposed_parent_rx(sock *sk, uint size UNUSED)
|
|||||||
};
|
};
|
||||||
|
|
||||||
int e = recvmsg(sk->fd, &m, 0);
|
int e = recvmsg(sk->fd, &m, 0);
|
||||||
|
if (e < 3)
|
||||||
|
{
|
||||||
|
log(L_ERR "Exposed parent RX hangup, what the hell");
|
||||||
|
sk_close(sk);
|
||||||
|
ev_send_loop(&main_birdloop, &poweroff_event);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct cmsghdr *c = CMSG_FIRSTHDR(&m);
|
struct cmsghdr *c = CMSG_FIRSTHDR(&m);
|
||||||
memcpy(&sfd, CMSG_DATA(c), sizeof sfd);
|
memcpy(&sfd, CMSG_DATA(c), sizeof sfd);
|
||||||
|
Loading…
Reference in New Issue
Block a user