mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fix: proper shutdown
This commit is contained in:
parent
b4ac52afa4
commit
f81c8125be
4 changed files with 7 additions and 8 deletions
|
@ -57,9 +57,9 @@ int main(int argc, char *argv[])
|
|||
fprintf(stderr, "# %-6s%-12s\n", "seq", "data");
|
||||
|
||||
/* Block until 1/p->rate seconds elapsed */
|
||||
while (1) {
|
||||
m.sequence += (uint16_t) timerfd_wait(tfd);
|
||||
|
||||
for (;;) {
|
||||
msg_random(&m);
|
||||
msg_fprint(stdout, &m);
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
|
|||
/* Print header */
|
||||
fprintf(stderr, "# %-6s %-8s %-12s\n", "dev_id", "seq_no", "data");
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
int recv = node_read(node, pool, node->combine, 0, node->combine);
|
||||
|
||||
for (int i = 0; i < recv; i++) {
|
||||
|
|
|
@ -129,6 +129,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
node_write(node, pool, node->combine, 0, node->combine);
|
||||
}
|
||||
|
||||
quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -87,9 +87,8 @@ static void signals_init()
|
|||
};
|
||||
|
||||
sigemptyset(&sa_quit.sa_mask);
|
||||
sigaction(SIGQUIT, &sa_quit, NULL);
|
||||
sigaction(SIGTERM, &sa_quit, NULL);
|
||||
sigaction(SIGINT, &sa_quit, NULL);
|
||||
sigaction(SIGTERM, &sa_quit, NULL);
|
||||
}
|
||||
|
||||
static void usage(const char *name)
|
||||
|
@ -166,16 +165,14 @@ int main(int argc, char *argv[])
|
|||
"Source " MAG("=>") " Destination", "#Sent", "#Recv", "#Drop", "#Skip", "#Inval");
|
||||
line();
|
||||
|
||||
do { FOREACH(&paths, it) {
|
||||
for (;;) FOREACH(&paths, it) {
|
||||
usleep(settings.stats * 1e6);
|
||||
path_print_stats(it->path);
|
||||
} } while (1);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
pause();
|
||||
|
||||
quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue